Data distribution mechanism in the form of ink dots on cards

ABSTRACT

A card for causing the device to operate in a predetermined operation mode. The card comprises, on a first surface, a visual representation of the operation mode, and on a second surface, a visually encoded representation of the operation mode. The encoded representation is readable and decodable by the device so as to cause the device to operate in the operation mode. Methods of determining an output data of sensed data are also disclosed.

[0001] This is a Divisional Application of U.S. Ser. No. 09/112,781filed Jul. 10, 1998

FIELD OF THE INVENTION

[0002] The present invention relates to a data distribution system andin particular discloses a data distribution mechanism in the form ofDotcards.

BACKGROUND OF THE INVENTION

[0003] Methods for distribution of data for automatic reading bycomputer systems are well known. For example, barcodes are oftenutilised in conjunction with an optical scanner for the distribution ofcorresponding barcode data. Further, magnetic ink scanning systems haveparticular application on bank cheques which are automatically scannedand the original data determined from the cheque.

[0004] There is a general need for a print media scanning system thatallows for high volumes of computer data to be stored on simple printmedia, such as a card, and to simultaneously be able to tolerate a highdegree of corruption of the data. For example, the form of distributioncan suffer a number of data corruption errors when the surface isscanned by a scanning device. The errors can include:

[0005] 1. Dead pixel errors which are a result of reading the surface ofthe card with a linear CCD having a faulty pixel reader for a linethereby producing the same value for all points on the line.

[0006] 2. The system adopted should tolerate writing errors wherein textis written by the owner of the card on the surface. Such text writingerrors are ideally tolerated by any scanning system scanning the card.

[0007] 3. Various data errors on the surface of the card may rise andany scuffs or blotches should be tolerated by any system determining theinformation stored on the surface of the card.

[0008] 4. A certain degree of “play” exists in the insertion of the cardinto a card reader. This play can comprise a degree of rotation of thecard when read by a card reader.

[0009] 5. Further, the card reader is assumed to be driven past a CCDtype scanner device by means of an electric motor. The electric motormay experience a degree of fluctuation which will result in fluctuationsin the rate of transmission of the data across the surface of the CCD.These motor fluctuation errors should also be tolerated by the dataencoding method on the surface of the card.

[0010] 6. The scanner of the surface of the card may experience variousdevice fluctuations such that the intensity of individual pixels mayvary. Reader intensity variations should also be accounted for in anysystem or method implemented in the data contained on the surface of thecard.

[0011] Many forms of condensed information storage are well known. Forexample, in the field of computer devices, it is common to utilizemagnetic disc drives which can be of a fixed or portable nature. Inrespect of portable discs, “Floppy Discs”, “Zip Discs”, and other formsof portable magnetic storage media have achieved a large degree ofacceptance on the market place.

[0012] Another form of portable storage is the compact disc “CD” whichutilizes a series of elongated pits along a spiral track which is readby a laser beam device. The utilization of Compact Disks provides for anextremely low cost form of storage. However, the technologies involvedare quite complex and the use of rewritable CD type devices is extremelylimited.

[0013] Other forms of storage include magnetic cards, often utilized forcredit cards or the like. These cards normally have a magnetic strip onthe back for recording information which is of relevance to the carduser. Recently, the convenience of magnetic cards has been extended inthe form of SmartCard technology which includes incorporation ofintegrated circuit type devices on to the card. Unfortunately, the costof such devices is often high and the complexity of the technologyutilized can also be significant.

SUMMARY OF THE INVENTION

[0014] In accordance with a first aspect of the invention, there isprovided a method of determining an output data value of sensed data,the method comprising the steps of:

[0015] (a) dividing a sensed data value into three contiguous regionscomprising a middle region, a lower region, and an upper region, and:

[0016] (b) with each value in the lower region, designating thecorresponding bit value to be a first value;

[0017] (c) with each value in the upper region, designating thecorresponding bit value to be a second value; and

[0018] (d) with each value in the middle region, utilising the spatiallysurrounding values to determine whether said value in the middle regionis a first value or a second value.

[0019] In accordance with a second aspect of the invention, there isprovided a card for operating a device, said card being adapted tocooperate with said device so as to cause the device to operate in apredetermined operation mode, wherein said card comprises, on a firstsurface, a visual representation of said operation mode, and on a secondsurface, a visually encoded representation of said operation mode, saidencoded representation being readable by said device and decodable bysaid device so as to cause the device to operate in said operation mode.

[0020] Preferably, the device comprises a camera adapted to receive asensed image, and means for transforming the appearance of the sensedimage, wherein the visual representation is indicative of a mode ofoperation wherein a particular transformation is applied to the sensedimage.

[0021] In an alternative embodiment, the device comprises a book readerand said card includes a book contents portion for display by said bookreader.

[0022] In accordance with a third aspect of the invention, there isprovided a method of distributing information on a card, said methodcomprising the steps of:

[0023] dividing a surface of the card into a plurality of predeterminedareas;

[0024] printing a first data portion onto a first predetermined area;

[0025] utilising said printed first data portion when readinginformation stored on said card;

[0026] and when the information stored on the card is to be updated,identifying a second predetermined area to print further information onsaid card, said second predetermined area not having been previouslyutilised to print data.

[0027] Preferably, the predetermined areas are selected in apredetermined order.

[0028] In a preferred embodiment, the printing utilises a highresolution ink dot printer.

[0029] Preferably, the data portion is printed in an encoded form havinga degree of fault tolerance. More preferably, the data portion isprinted in a Reed-Solomon encoded form.

[0030] In a preferred form, the data portion is replicated in a chosenpredetermined area. Preferably, each of the predetermined areas includesa number of border target markers indicating the location of saidregion. More preferably, the border markers are utilised when readinginformation stored on the card to locate said predetermined areas.

[0031] Preferably, the border targets comprise a relatively large areaof a first colour and a relatively small area of a second colour locatedcentrally of said relatively large area.

[0032] In accordance with a fourth aspect of the invention, there isprovided an information carrier that comprises:

[0033] a card; and

[0034] a plurality of dots that are printed on the card, the pluralityof dots carrying data representing a set of instructions that arereadable by a processing device, the array of dots having the followingcharacteristics:

[0035] the dots are set out in a generally rectangular array with alogical upper side, a logical lower side, a logical left side and alogical right side, with a data area bounded by the logical sides;

[0036] the dots define a plurality of targets that extend along both thelogical left and the right side of the array, each target beingidentifiable as such by a reading device;

[0037] the dots are positioned in a plurality of substantially parallelcolumns that extend between the logical upper and lower sides of thearray; and

[0038] the dots define a plurality of clock markers that are positionedalong each of the upper and lower logical sides of the array, in alignedpairs with each said column extending between clock markers ofrespective pairs.

[0039] In accordance with a fifth aspect of the invention, there isprovided an information carrier that comprises:

[0040] a card;

[0041] a plurality of dots that are printed on the card, the pluralityof dots carrying data representing a set of instructions that arereadable by a processing device, the array of dots having the followingcharacteristics:

[0042] the dots are set out in a generally rectangular array;

[0043] the dots define a plurality of rectangular data blocks making upthe array, each rectangular data block having a logical left side, alogical right side, a logical upper side and a logical lower side;

[0044] the dots define a plurality of targets that extend along both thelogical left side and the right side of the array, each target beingidentifiable as such by a reading device;

[0045] the dots of each data block are positioned in a plurality ofsubstantially parallel columns that extend between the logical upper andlower sides of the data block; and

[0046] the dots define a plurality of clock markers that are positionedalong each of the upper and lower logical sides of the data blocks, inaligned pairs with each said column extending between clock markers ofrespective pairs.

[0047] Other preferred aspects of the invention are disclosed in thedetailed description below.

BRIEF DESCRIPTION OF THE DRAWINGS

[0048] Notwithstanding any other forms which may fall within the scopeof the present invention, preferred forms of the invention will now bedescribed, by way of example only, with reference to the accompanyingdrawings in which:

[0049]FIG. 1 illustrates an Artcam device constructed in accordance withthe preferred embodiment;

[0050]FIG. 2 is a schematic block diagram of the main Artcam electroniccomponents;

[0051]FIG. 3 is a schematic block diagram of the Artcam CentralProcessor;

[0052]FIG. 3(a) illustrates the VLIW Vector Processor in more detail;

[0053]FIG. 4 illustrates the Processing Unit in more detail;

[0054]FIG. 5 illustrates the ALU 188 in more detail;

[0055]FIG. 6 illustrates the In block in more detail;

[0056]FIG. 7 illustrates the Out block in more detail;

[0057]FIG. 8 illustrates the Registers block in more detail;

[0058]FIG. 9 illustrates the Crossbar1 in more detail;

[0059]FIG. 10 illustrates the Crossbar2 in more detail;

[0060]FIG. 11 illustrates the read process block in more detail;

[0061]FIG. 12 illustrates the read process block in more detail;

[0062]FIG. 13 illustrates the barrel shifter block in more detail;

[0063]FIG. 14 illustrates the adder/logic block in more detail;

[0064]FIG. 15 illustrates the multiply block in more detail;

[0065]FIG. 16 illustrates the I/O address generator block in moredetail;

[0066]FIG. 17 illustrates a pixel storage format;

[0067]FIG. 18 illustrates a sequential read iterator process;

[0068]FIG. 19 illustrates a box read iterator process;

[0069]FIG. 20 illustrates a box write iterator process;

[0070]FIG. 21 illustrates the vertical strip read/write iteratorprocess;

[0071]FIG. 22 illustrates the vertical strip read/write iteratorprocess;

[0072]FIG. 23 illustrates the generate sequential process;

[0073]FIG. 24 illustrates the generate sequential process;

[0074]FIG. 25 illustrates the generate vertical strip process;

[0075]FIG. 26 illustrates the generate vertical strip process;

[0076]FIG. 27 illustrates a pixel data configuration;

[0077]FIG. 28 illustrates a pixel processing process;

[0078]FIG. 29 illustrates a schematic block diagram of the displaycontroller;

[0079]FIG. 30 illustrates the CCD image organization;

[0080]FIG. 31 illustrates the storage format for a logical image;

[0081]FIG. 32 illustrates the internal image memory storage format;

[0082]FIG. 33 illustrates the image pyramid storage format;

[0083]FIG. 34 illustrates a time line of the process of sampling anArtcard;

[0084]FIG. 35 illustrates the super sampling process;

[0085]FIG. 36 illustrates the process of reading a rotated Artcard;

[0086]FIG. 37 illustrates a flow chart of the steps necessary to decodean Artcard;

[0087]FIG. 38 illustrates an enlargement of the left hand corner of asingle Artcard;

[0088]FIG. 39 illustrates a single target for detection;

[0089]FIG. 40 illustrates the method utilised to detect targets;

[0090]FIG. 41 illustrates the method of calculating the distance betweentwo targets;

[0091]FIG. 42 illustrates the process of centroid drift;

[0092]FIG. 43 shows one form of centroid lookup table;

[0093]FIG. 44 illustrates the centroid updating process;

[0094]FIG. 45 illustrates a delta processing lookup table utilised inthe preferred embodiment;

[0095]FIG. 46 illustrates the process of unscrambling Artcard data;

[0096]FIG. 47 illustrates a magnified view of a series of dots;

[0097]FIG. 48 illustrates the data surface of a dot card;

[0098]FIG. 49 illustrates schematically the layout of a singledatablock;

[0099]FIG. 50 illustrates a single datablock;

[0100]FIG. 51 and FIG. 52 illustrate magnified views of portions of thedatablock of FIG. 50;

[0101]FIG. 53 illustrates a single target structure;

[0102]FIG. 54 illustrates the target structure of a datablock;

[0103]FIG. 55 illustrates the positional relationship of targetsrelative to border clocking regions of a data region;

[0104]FIG. 56 illustrates the orientation columns of a datablock;

[0105]FIG. 57 illustrates the array of dots of a datablock;

[0106]FIG. 58 illustrates schematically the structure of data forReed-Solomon encoding;

[0107]FIG. 59 illustrates an example Reed-Solomon encoding;

[0108]FIG. 60 illustrates the Reed-Solomon encoding process;

[0109]FIG. 61 illustrates the layout of encoded data within a datablock;

[0110]FIG. 62 illustrates the sampling process in sampling analternative Artcard;

[0111]FIG. 63 illustrates, in exaggerated form, an example of sampling arotated alternative Artcard;

[0112]FIG. 64 illustrates the scanning process;

[0113]FIG. 65 illustrates the likely scanning distribution of thescanning process;

[0114]FIG. 66 illustrates the relationship between probability of symbolerrors and Reed-Solomon block errors;

[0115]FIG. 67 illustrates a flow chart of the decoding process;

[0116]FIG. 68 illustrates a process utilization diagram of the decodingprocess;

[0117]FIG. 69 illustrates the dataflow steps in decoding;

[0118]FIG. 70 illustrates the reading process in more detail;

[0119]FIG. 71 illustrates the process of detection of the start of analternative Artcard in more detail;

[0120]FIG. 72 illustrates the extraction of bit data process in moredetail;

[0121]FIG. 73 illustrates the segmentation process utilized in thedecoding process;

[0122]FIG. 74 illustrates the decoding process of finding targets inmore detail;

[0123]FIG. 75 illustrates the data structures utilized in locatingtargets;

[0124]FIG. 76 illustrates the Lancos 3 function structure;

[0125]FIG. 77 illustrates an enlarged portion of a datablockillustrating the clockmark and border region;

[0126]FIG. 78 illustrates the processing steps in decoding a bit image;

[0127]FIG. 79 illustrates the dataflow steps in decoding a bit image;

[0128]FIG. 80 illustrates the descrambling process of the preferredembodiment;

[0129]FIG. 81 illustrates one form of implementation of the convolver;

[0130]FIG. 82 illustrates a convolution process;

[0131]FIG. 83 illustrates the compositing process;

[0132]FIG. 84 illustrates the regular compositing process in moredetail;

[0133]FIG. 85 illustrates the process of warping using a warp map;

[0134]FIG. 86 illustrates the warping bi-linear interpolation process;

[0135]FIG. 87 illustrates the process of span calculation;

[0136]FIG. 88 illustrates the basic span calculation process;

[0137]FIG. 89 illustrates one form of detail implementation of the spancalculation process;

[0138]FIG. 90 illustrates the process of reading image pyramid levels;

[0139]FIG. 91 illustrates using the pyramid table for blinearinterpolation;

[0140]FIG. 92 illustrates the histogram collection process;

[0141]FIG. 93 illustrates the color transform process;

[0142]FIG. 94 illustrates the color conversion process;

[0143]FIG. 95 illustrates the color space conversion process in moredetail;

[0144]FIG. 96 illustrates the process of calculating an inputcoordinate;

[0145]FIG. 97 illustrates the process of compositing with feedback;

[0146]FIG. 98 illustrates the generalized scaling process;

[0147]FIG. 99 illustrates the scale in X scaling process;

[0148]FIG. 100 illustrates the scale in Y scaling process;

[0149]FIG. 101 illustrates the tessellation process;

[0150]FIG. 102 illustrates the sub-pixel translation process;

[0151]FIG. 103 illustrates the compositing process;

[0152]FIG. 104 illustrates the process of compositing with feedback;

[0153]FIG. 105 illustrates the process of tiling with color from theinput image;

[0154]FIG. 106 illustrates the process of tiling with feedback;

[0155]FIG. 107 illustrates the process of tiling with texturereplacement;

[0156]FIG. 108 illustrates the process of tiling with color from theinput image;

[0157]FIG. 109 illustrates the process of applying a texture withoutfeedback;

[0158]FIG. 110 illustrates the process of applying a texture withfeedback;

[0159]FIG. 111 illustrates the process of rotation of CCD pixels;

[0160]FIG. 112 illustrates the process of interpolation of Greensubpixels;

[0161]FIG. 113 illustrates the process of interpolation of Bluesubpixels;

[0162]FIG. 114 illustrates the process of interpolation of Redsubpixels;

[0163]FIG. 115 illustrates the process of CCD pixel interpolation with 0degree rotation for odd pixel lines;

[0164]FIG. 116 illustrates the process of CCD pixel interpolation with 0degree rotation for even pixel lines;

[0165]FIG. 117 illustrates the process of color conversion to Lab colorspace;

[0166]FIG. 118 illustrates the process of calculation of 1/{squareroot}X;

[0167]FIG. 119 illustrates the implementation of the calculation of1/{square root}X in more detail;

[0168]FIG. 120 illustrates the process of Normal calculation with a bumpmap;

[0169]FIG. 121 illustrates the process of illumination calculation witha bump map;

[0170]FIG. 122 illustrates the process of illumination calculation witha bump map in more detail;

[0171]FIG. 123 illustrates the process of calculation of L using adirectional light;

[0172]FIG. 124 illustrates the process of calculation of L using a Omnilights and spotlights;

[0173]FIG. 125 illustrates one form of implementation of calculation ofL using a Omni lights and spotlights;

[0174]FIG. 126 illustrates the process of calculating the N.L dotproduct;

[0175]FIG. 127 illustrates the process of calculating the N.L dotproduct in more detail;

[0176]FIG. 128 illustrates the process of calculating the R.V dotproduct;

[0177]FIG. 129 illustrates the process of calculating the R.V dotproduct in more detail;

[0178]FIG. 130 illustrates the attenuation calculation inputs andoutputs;

[0179]FIG. 131 illustrates an actual implementation of attenuationcalculation;

[0180]FIG. 132 illustrates an graph of the cone factor;

[0181]FIG. 133 illustrates the process of penumbra calculation;

[0182]FIG. 134 illustrates the angles utilised in penumbra calculation;

[0183]FIG. 135 illustrates the inputs and outputs to penumbracalculation;

[0184]FIG. 136 illustrates an actual implementation of penumbracalculation;

[0185]FIG. 137 illustrates the inputs and outputs to ambientcalculation;

[0186]FIG. 138 illustrates an actual implementation of ambientcalculation;

[0187]FIG. 139 illustrates an actual implementation of diffusecalculation;

[0188]FIG. 140 illustrates the inputs and outputs to a diffusecalculation;

[0189]FIG. 141 illustrates an actual implementation of a diffusecalculation;

[0190]FIG. 142 illustrates the inputs and outputs to a specularcalculation;

[0191]FIG. 143 illustrates an actual implementation of a specularcalculation;

[0192]FIG. 144 illustrates the inputs and outputs to a specularcalculation;

[0193]FIG. 145 illustrates an actual implementation of a specularcalculation;

[0194]FIG. 146 illustrates an actual implementation of a ambient onlycalculation;

[0195]FIG. 147 illustrates the process overview of light calculation;

[0196]FIG. 148 illustrates an example illumination calculation for asingle infinite light source;

[0197]FIG. 149 illustrates an example illumination calculation for aOmni light source without a bump map;

[0198]FIG. 150 illustrates an example illumination calculation for aOmni light source with a bump map;

[0199]FIG. 151 illustrates an example illumination calculation for aSpotlight light source without a bump map;

[0200]FIG. 152 illustrates the process of applying a single Spotlightonto an image with an associated bump-map;

[0201]FIG. 153 illustrates the logical layout of a single printhead;

[0202]FIG. 154 illustrates the structure of the printhead interface;

[0203]FIG. 155 illustrates the process of rotation of a Lab image;

[0204]FIG. 156 illustrates the format of a pixel of the printed image;

[0205]FIG. 157 illustrates the dithering process;

[0206]FIG. 158 illustrates the process of generating an 8 bit dotoutput;

[0207]FIG. 159 illustrates a perspective view of the card reader;

[0208]FIG. 160 illustrates an exploded perspective of a card reader;

[0209]FIG. 161 illustrates a close up view of the Artcard reader;

[0210]FIG. 162 illustrates a perspective view of the print roll andprint head;

[0211]FIG. 163 illustrates a first exploded perspective view of theprint roll;

[0212]FIG. 164 illustrates a second exploded perspective view of theprint roll;

[0213]FIG. 165 illustrates the print roll authentication chip;

[0214]FIG. 166 illustrates an enlarged view of the print rollauthentication chip;

[0215]FIG. 167 illustrates a single authentication chip data protocol;

[0216]FIG. 168 illustrates a dual authentication chip data protocol;

[0217]FIG. 169 illustrates a first presence only protocol;

[0218]FIG. 170 illustrates a second presence only protocol;

[0219]FIG. 171 illustrates a third data protocol;

[0220]FIG. 172 illustrates a fourth data protocol;

[0221]FIG. 173 is a schematic block diagram of a maximal period LFSR;

[0222]FIG. 174 is a schematic block diagram of a clock limiting filter;

[0223]FIG. 175 is a schematic block diagram of the tamper detectionlines;

[0224]FIG. 176 illustrates an oversized nMOS transistor;

[0225]FIG. 177 illustrates the taking of multiple XORs from the TamperDetect Line

[0226]FIG. 178 illustrate how the Tamper Lines cover the noise generatorcircuitry;

[0227]FIG. 179 illustrates the normal form of FET implementation;

[0228]FIG. 180 illustrates the modified form of FET implementation ofthe preferred embodiment;

[0229]FIG. 181 illustrates a schematic block diagram of theauthentication chip;

[0230]FIG. 182 illustrates an example memory map;

[0231]FIG. 183 illustrates an example of the constants memory map;

[0232]FIG. 184 illustrates an example of the RAM memory map;

[0233]FIG. 185 illustrates an example of the Flash memory variablesmemory map;

[0234]FIG. 186 illustrates an example of the Flash memory program memorymap;

[0235]FIG. 187 shows the data flow and relationship between componentsof the State Machine;

[0236]FIG. 188 shows the data flow and relationship between componentsof the I/O Unit.

[0237]FIG. 189 illustrates a schematic block diagram of the ArithmeticLogic Unit;

[0238]FIG. 190 illustrates a schematic block diagram of the RPL unit;

[0239]FIG. 191 illustrates a schematic block diagram of the ROR block ofthe ALU;

[0240]FIG. 192 is a block diagram of the Program Counter Unit;

[0241]FIG. 193 is a block diagram of the Memory Unit;

[0242]FIG. 194 shows a schematic block diagram for the Address GeneratorUnit;

[0243]FIG. 195 shows a schematic block diagram for the JSIGEN Unit;

[0244]FIG. 196 shows a schematic block diagram for the JSRGEN Unit.

[0245]FIG. 197 shows a schematic block diagram for the DBRGEN Unit;

[0246]FIG. 198 shows a schematic block diagram for the LDKGEN Unit;

[0247]FIG. 199 shows a schematic block diagram for the RPLGEN Unit;

[0248]FIG. 200 shows a schematic block diagram for the VARGEN Unit.

[0249]FIG. 201 shows a schematic block diagram for the CLRGEN Unit.

[0250]FIG. 202 shows a schematic block diagram for the BITGEN Unit.

[0251]FIG. 203 sets out the information stored on the print rollauthentication chip;

[0252]FIG. 204 illustrates the data stored within the Artcamauthorization chip;

[0253]FIG. 205 illustrates the process of print head pulsecharacterization;

[0254]FIG. 206 is an exploded perspective, in section, of the print headink supply mechanism;

[0255]FIG. 207 is a bottom perspective of the ink head supply unit;

[0256]FIG. 208 is a bottom side sectional view of the ink head supplyunit;

[0257]FIG. 209 is a top perspective of the ink head supply unit;

[0258]FIG. 210 is a top side sectional view of the ink head supply unit;

[0259]FIG. 211 illustrates a perspective view of a small portion of theprint head;

[0260]FIG. 212 illustrates is an exploded perspective of the print headunit;

[0261]FIG. 213 illustrates a top side perspective view of the internalportions of an Artcam camera, showing the parts flattened out;

[0262]FIG. 214 illustrates a bottom side perspective view of theinternal portions of an Artcam camera, showing the parts flattened out;

[0263]FIG. 215 illustrates a first top side perspective view of theinternal portions of an Artcam camera, showing the parts as encased inan Artcam;

[0264]FIG. 216 illustrates a second top side perspective view of theinternal portions of an Artcam camera, showing the parts as encased inan Artcam;

[0265]FIG. 217 illustrates a second top side perspective view of theinternal portions of an Artcam camera, showing the parts as encased inan Artcam;

[0266]FIG. 218 illustrates the backing portion of a postcard print roll;

[0267]FIG. 219 illustrates the corresponding front image on the postcardprint roll after printing out images;

[0268]FIG. 220 illustrates a form of print roll ready for purchase by aconsumer;

[0269]FIG. 221 illustrates a layout of the software/hardware modules ofthe overall Artcam application;

[0270]FIG. 222 illustrates a layout of the software/hardware modules ofthe Camera Manager;

[0271]FIG. 223 illustrates a layout of the software/hardware modules ofthe Image Processing Manager;

[0272]FIG. 224 illustrates a layout of the software/hardware modules ofthe Printer Manager;

[0273]FIG. 225 illustrates a layout of the software/hardware modules ofthe Image Processing Manager;

[0274]FIG. 226 illustrates a layout of the software/hardware modules ofthe File Manager;

[0275]FIG. 227 illustrates a perspective view, partly in section, of analternative form of printroll;

[0276]FIG. 228 is a left side exploded perspective view of the printroll of FIG. 227;

[0277]FIG. 229 is a right side exploded perspective view of a singleprintroll;

[0278]FIG. 230 is an exploded perspective view, partly in section, ofthe core portion of the printroll; and

[0279]FIG. 231 is a second exploded perspective view of the core portionof the printroll.

DESCRIPTION OF PREFERRED AND OTHER EMBODIMENTS

[0280] The digital image processing camera system constructed inaccordance with the preferred embodiment is as illustrated in FIG. 1.The camera unit 1 includes means for the insertion of an integral printroll (not shown). The camera unit 1 can include an area image sensor 2which sensors an image 3 for captured by the camera. Optionally, thesecond area image sensor can be provided to also image the scene 3 andto optionally provide for the production of stereographic outputeffects.

[0281] The camera 1 can include an optional color display 5 for thedisplay of the image being sensed by the sensor 2. When a simple imageis being displayed on the display 5, the button 6 can be depressedresulting in the printed image 8 being output by the camera unit 1. Aseries of cards, herein after known as “Artcards” 9 contain, on onesurface encoded information and on the other surface, contain an imagedistorted by the particular effect produced by the Artcard 9. TheArtcard 9 is inserted in an Artcard reader 10 in the side of camera 1and, upon insertion, results in output image 8 being distorted in thesame manner as the distortion appearing on the surface of Artcard 9.Hence, by means of this simple user interface a user wishing to producea particular effect can insert one of many Artcards 9 into the Artcardreader 10 and utilize button 19 to take a picture of the image 3resulting in a corresponding distorted output image 8.

[0282] The camera unit 1 can also include a number of other controlbutton 13, 14 in addition to a simple LCD output display 15 for thedisplay of informative information including the number of printoutsleft on the internal print roll on the camera unit. Additionally,different output formats can be controlled by CHP switch 17.

[0283] Turning now to FIG. 2, there is illustrated a schematic view ofthe internal hardware of the camera unit 1. The internal hardware isbased around an Artcam central processor unit (ACP) 31.

[0284] Artcam Central Processor 31

[0285] The Artcam central processor 31 provides many functions whichform the ‘heart’ of the system. The ACP 31 is preferably implemented asa complex, high speed, CMOS system on-a-chip. Utilising standard celldesign with some full custom regions is recommended. Fabrication on a0.25μ CMOS process will provide the density and speed required, alongwith a reasonably small die area.

[0286] The functions provided by the ACP 31 include:

[0287] 1. Control and digitization of the area image sensor 2. A 3Dstereoscopic version of the ACP requires two area image sensorinterfaces with a second optional image sensor 4 being provided forstereoscopic effects.

[0288] 2. Area image sensor compensation, reformatting, and imageenhancement.

[0289] 3. Memory interface and management to a memory store 33.

[0290] 4. Interface, control, and analog to digital conversion of anArtcard reader linear image sensor 34 which is provided for the readingof data from the Artcards 9.

[0291] 5. Extraction of the raw Artcard data from the digitized andencoded Artcard image.

[0292] 6. Reed-Solomon error detection and correction of the Artcardencoded data. The encoded surface of the Artcard 9 includes informationon how to process an image to produce the effects displayed on the imagedistorted surface of the Artcard 9. This information is in the form of ascript, hereinafter known as a “Vark script”. The Vark script isutilised by an interpreter running within the ACP 31 to produce thedesired effect.

[0293] 7. Interpretation of the Vark script on the Artcard 9.

[0294] 8. Performing image processing operations as specified by theVark script.

[0295] 9. Controlling various motors for the paper transport 36, zoomlens 38, autofocus 39 and Artcard driver 37.

[0296] 10. Controlling a guillotine actuator 40 for the operation of aguillotine 41 for the cutting of photographs 8 from print roll 42.

[0297] 11. Half-toning of the image data for printing.

[0298] 12. Providing the print data to a print-head 44 at theappropriate times.

[0299] 13. Controlling the print head 44.

[0300] 14. Controlling the ink pressure feed to print-head 44.

[0301] 15. Controlling optional flash unit 56.

[0302] 16. Reading and acting on various sensors in the camera,including camera orientation sensor 46, autofocus 47 and Artcardinsertion sensor 49.

[0303] 17. Reading and acting on the user interface buttons 6, 13, 14.

[0304] 18. Controlling the status display 15.

[0305] 19. Providing viewfinder and preview images to the color display5.

[0306] 20. Control of the system power consumption, including the ACPpower consumption via power management circuit 51 .

[0307] 21. Providing external communications 52 to general purposecomputers (using part USB).

[0308] 22. Reading and storing information in a printing rollauthentication chip 53.

[0309] 23. Reading and storing information in a camera authenticationchip 54.

[0310] 24. Communicating with an optional mini-keyboard 57 for textmodification.

[0311] Quartz Crystal 58

[0312] A quartz crystal 58 is used as a frequency reference for thesystem clock. As the system clock is very high, the ACP 31 includes aphase locked loop clock circuit to increase the frequency derived fromthe crystal 58.

[0313] Image Sensing

[0314] Area image sensor 2

[0315] The area image sensor 2 converts an image through its lens intoan electrical signal. It can either be a charge coupled device (CCD) oran active pixel sensor (APS) CMOS image sector. At present, availableCCD's normally have a higher image quality, however, there is currentlymuch development occurring in CMOS imagers. CMOS imagers are eventuallyexpected to be substantially cheaper than CCD's have smaller pixelareas, and be able to incorporate drive circuitry and signal processing.They can also be made in CMOS fabs, which are transitioning to 12″wafers. CCD's are usually built in 6″ wafer fabs, and economics may notallow a conversion to 12″ fabs. Therefore, the difference in fabricationcost between CCD's and CMOS imagers is likely to increase, progressivelyfavoring CMOS imagers. However, at present, a CCD is probably the bestoption.

[0316] The Artcam unit will produce suitable results with a 1,500×1,000area image sensor. However, smaller sensors, such as 750×500, will beadequate for many markets. The Artcam is less sensitive to image sensorresolution than are conventional digital cameras. This is because manyof the styles contained on Artcards 9 process the image in such a way asto obscure the lack of resolution. For example, if the image isdistorted to simulate the effect of being converted to animpressionistic painting, low source image resolution can be used withminimal effect. Further examples for which low resolution input imageswill typically not be noticed include image warps which produce highdistorted images, multiple miniature copies of the of the image (eg.passport photos), textural processing such as bump mapping for a baserelief metal look, and photo-compositing into structured scenes.

[0317] This tolerance of low resolution image sensors may be asignificant factor in reducing the manufacturing cost of an Artcam unit1 camera. An Artcam with a low cost 750×500 image sensor will oftenproduce superior results to a conventional digital camera with a muchmore expensive 1,500×1,000 image sensor.

[0318] Optional Stereoscopic 3D Image Sensor 4

[0319] The 3D versions of the Artcam unit 1 have an additional imagesensor 4, for stereoscopic operation. This image sensor is identical tothe main image sensor. The circuitry to drive the optional image sensormay be included as a standard part of the ACP chip 31 to reduceincremental design cost. Alternatively, a separate 3D Artcam ACP can bedesigned. This option will reduce the manufacturing cost of a mainstreamsingle sensor Artcam.

[0320] Print Roll Authentication Chip 53

[0321] A small chip 53 is included in each print roll 42. This chipreplaced the functions of the bar code, optical sensor and wheel, andISO/ASA sensor on other forms of camera film units such as AdvancedPhoto Systems film cartridges.

[0322] The authentication chip also provides other features:

[0323] 1. The storage of data rather than that which is mechanically andoptically sensed from APS rolls

[0324] 2. A remaining media length indication, accurate to highresolution.

[0325] 3. Authentication Information to prevent inferior clone printroll copies.

[0326] The authentication chip 53 contains 1024 bits of Flash memory, ofwhich 128 bits is an authentication key, and 512 bits is theauthentication information. Also included is an encryption circuit toensure that the authentication key cannot be accessed directly.

[0327] Print-Head 44

[0328] The Artcam unit 1 can utilize any color print technology which issmall enough, low enough power, fast enough, high enough quality, andlow enough cost, and is compatible with the print roll. Relevantprintheads will be specifically discussed hereinafter.

[0329] The specifications of the ink jet head are: Image type Bi-level,dithered Color CMY Process Color Resolution 1600 dpi Print head length‘Page-width’ (100 mm) Print speed 2 seconds per photo

[0330] Optional Ink Pressure Controller (Not Shown)

[0331] The function of the ink pressure controller depends upon the typeof ink jet print head 44 incorporated in the Artcam. For some types ofink jet, the use of an ink pressure controller can be eliminated, as theink pressure is simply atmospheric pressure. Other types of print headrequire a regulated positive ink pressure. In this case, the in pressurecontroller consists of a pump and pressure transducer.

[0332] Other print heads may require an ultrasonic transducer to causeregular oscillations in the ink pressure, typically at frequenciesaround 100 KHz. In the case, the ACP 31 controls the frequency phase andamplitude of these oscillations.

[0333] Paper Transport Motor 36

[0334] The paper transport motor 36 moves the paper from within theprint roll 42 past the print head at a relatively constant rate. Themotor 36 is a miniature motor geared down to an appropriate speed todrive rollers which move the paper. A high quality motor and mechanicalgears are required to achieve high image quality, as mechanical rumbleor other vibrations will affect the printed dot row spacing.

[0335] Paper Transport Motor Driver 60

[0336] The motor driver 60 is a small circuit which amplifies thedigital motor control signals from the APC 31 to levels suitable fordriving the motor 36.

[0337] Paper Pull Sensor

[0338] A paper pull sensor 50 detects a user's attempt to pull a photofrom the camera unit during the printing process. The APC 31 reads thissensor 50, and activates the guillotine 41 if the condition occurs. Thepaper pull sensor 50 is incorporated to make the camera more ‘foolproof’in operation. Were the user to pull the paper out forcefully duringprinting, the print mechanism 44 or print roll 42 may (in extreme cases)be damaged. Since it is acceptable to pull out the ‘pod’ from a Polaroidtype camera before it is fully ejected, the public has been ‘trained’ todo this. Therefore, they are unlikely to heed printed instructions notto pull the paper.

[0339] The Artcam preferably restarts the photo print process after theguillotine 41 has cut the paper after pull sensing.

[0340] The pull sensor can be implemented as a strain gauge sensor, oras an optical sensor detecting a small plastic flag which is deflectedby the torque that occurs on the paper drive rollers when the paper ispulled. The latter implementation is recommendation for low cost.

[0341] Paper Guillotine Actuator 40

[0342] The paper guillotine actuator 40 is a small actuator which causesthe guillotine 41 to cut the paper either at the end of a photograph, orwhen the paper pull sensor 50 is activated.

[0343] The guillotine actuator 40 is a small circuit which amplifies aguillotine control signal from the APC tot the level required by theactuator 41.

[0344] Artcard 9

[0345] The Artcard 9 is a program storage medium for the Artcam unit. Asnoted previously, the programs are in the form of Vark scripts. Vark isa powerful image processing language especially developed for the Artcamunit. Each Artcard 9 contains one Vark script, and thereby defines oneimage processing style.

[0346] Preferably, the VARK language is highly image processingspecific. By being highly image processing specific, the amount ofstorage required to store the details on the card are substantiallyreduced. Further, the ease with which new programs can be created,including enhanced effects, is also substantially increased. Preferably,the language includes facilities for handling many image processingfunctions including image warping via a warp map, convolution, colorlookup tables, posterizing an image, adding noise to an image, imageenhancement filters, painting algorithms, brush jittering andmanipulation edge detection filters, tiling, illumination via lightsources, bump maps, text, face detection and object detectionattributes, fonts, including three dimensional fonts, and arbitrarycomplexity pre-rendered icons. Further details of the operation of theVark language interpreter are contained hereinafter.

[0347] Hence, by utilizing the language constructs as defined by thecreated language, new affects on arbitrary images can be created andconstructed for inexpensive storage on Artcard and subsequentdistribution to camera owners. Further, on one surface of the card canbe provided an example illustrating the effect that a particular VARKscript, stored on the other surface of the card, will have on anarbitrary captured image.

[0348] By utilizing such a system, camera technology can be distributedwithout a great fear of obsolescence in that, provided a VARKinterpreter is incorporated in the camera device, a device independentscenario is provided whereby the underlying technology can be completelyvaried over time. Further, the VARK scripts can be updated as newfilters are created and distributed in an inexpensive manner, such asvia simple cards for card reading.

[0349] The Artcard 9 is a piece of thin white plastic with the sameformat as a credit card (86 mm long by 54 mm wide). The Artcard isprinted on both sides using a high resolution ink jet printer. Theinkjet printer technology is assumed to be the same as that used in theArtcam, with 1600 dpi (63dpmm) resolution. A major feature of theArtcard 9 is low manufacturing cost. Artcards can be manufactured athigh speeds as a wide web of plastic film. The plastic web is coated onboth sides with a hydrophilic dye fixing layer. The web is printedsimultaneously on both sides using a ‘pagewidth’ color ink jet printer.The web is then cut and punched into individual cards. On one face ofthe card is printed a human readable representation of the effect theArtcard 9 will have on the sensed image. This can be simply a standardimage which has been processed using the Vark script stored on the backface of the card.

[0350] On the back face of the card is printed an array of dots whichcan be decoded into the Vark script that defines the image processingsequence. The print area is 80 mm×50 mm, giving a total of 15,876,000dots. This array of dots could represent at least 1.89 Mbytes of data.To achieve high reliability, extensive error detection and correction isincorporated in the array of dots. This allows a substantial portion ofthe card to be defaced, worn, creased, or dirty with no effect on dataintegrity. The data coding used is Reed-Solomon coding, with half of thedata devoted to error correction. This allows the storage of 967 Kbytesof error corrected data on each Artcard 9.

[0351] Linear Image Sensor 34

[0352] The Artcard linear sensor 34 converts the aforementioned Artcarddata image to electrical signals. As with the area image sensor 2, 4,the linear image sensor can be fabricated using either CCD or APS CMOStechnology. The active length of the image sensor 34 is 50 mm, equal tothe width of the data array on the Artcard 9. To satisfy Nyquist'ssampling theorem, the resolution of the linear image sensor 34 must beat least twice the highest spatial frequency of the Artcard opticalimage reaching the image sensor. In practice, data detection is easierif the image sensor resolution is substantially above this. A resolutionof 4800 dpi (189 dpmm) is chosen, giving a total of 9,450 pixels. Thisresolution requires a pixel sensor pitch of 5.3 μm. This can readily beachieved by using four staggered rows of 20 μm pixel sensors.

[0353] The linear image sensor is mounted in a special package whichincludes a LED 65 to illuminate the Artcard 9 via a light-pipe (notshown).

[0354] The Artcard reader light-pipe can be a molded light-pipe whichhas several function:

[0355] 1. It diffuses the light from the LED over the width of the cardusing total internal reflection facets.

[0356] 2. It focuses the light onto a 16 μm wide strip of the Artcard 9using an integrated cylindrical lens.

[0357] 3. It focuses light reflected from the Artcard onto the linearimage sensor pixels using a molded array of microlenses.

[0358] The operation of the Artcard reader is explained furtherhereinafter.

[0359] Artcard Reader Motor 37

[0360] The Artcard reader motor propels the Artcard past the linearimage sensor 34 at a relatively constant rate. As it may not be costeffective to include extreme precision mechanical components in theArtcard reader, the motor 37 is a standard miniature motor geared downto an appropriate speed to drive a pair of rollers which move theArtcard 9. The speed variations, rumble, and other vibrations willaffect the raw image data as circuitry within the APC 31 includesextensive compensation for these effects to reliably read the Artcarddata.

[0361] The motor 37 is driven in reverse when the Artcard is to beejected.

[0362] Artcard Motor Driver 61

[0363] The Artcard motor driver 61 is a small circuit which amplifiesthe digital motor control signals from the APC 31 to levels suitable fordriving the motor 37.

[0364] Card Insertion Sensor 49

[0365] The card insertion sensor 49 is an optical sensor which detectsthe presence of a card as it is being inserted in the card reader 34.Upon a signal from this sensor 49, the APC 31 initiates the card readingprocess, including the activation of the Artcard reader motor 37.

[0366] Card Eject Button 16

[0367] A card eject button 16 (FIG. 1) is used by the user to eject thecurrent Artcard, so that another Artcard can be inserted. The APC 31detects the pressing of the button, and reverses the Artcard readermotor 37 to eject the card.

[0368] Card Status Indicator 66

[0369] A card status indicator 66 is provided to signal the user as tothe status of the Artcard reading process. This can be a standardbi-color (red/green) LED. When the card is successfully read, and dataintegrity has been verified, the LED lights up green continually. If thecard is faulty, then the LED lights up red.

[0370] If the camera is powered from a 1.5 V instead of 3V battery, thenthe power supply voltage is less than the forward voltage drop of thegreed LED, and the LED will not light. In this case, red LEDs can beused, or the LED can be powered from a voltage pump which also powersother circuits in the Artcam which require higher voltage.

[0371] 64 Mbit DRAM 33

[0372] To perform the wide variety of image processing effects, thecamera utilizes 8 Mbytes of memory 33. This can be provided by a single64 Mbit memory chip. Of course, with changing memory technologyincreased Dram storage sizes may be substituted.

[0373] High speed access to the memory chip is required. This can beachieved by using a Rambus DRAM (burst access rate of 500 Mbytes persecond) or chips using the new open standards such as double data rate(DDR) SDRAM or Synclink DRAM.

[0374] Camera Authentication Chip

[0375] The camera authentication chip 54 is identical to the print rollauthentication chip 53, except that it has different information storedin it. The camera authentication chip 54 has three main purposes:

[0376] 1. To provide a secure means of comparing authentication codeswith the print roll authentication chip;

[0377] 2. To provide storage for manufacturing information, such as theserial number of the camera;

[0378] 3. To provide a small amount of non-volatile memory for storageof user information.

[0379] Displays

[0380] The Artcam includes an optional color display 5 and small statusdisplay 15. Lowest cost consumer cameras may include a color imagedisplay, such as a small TFT LCD 5 similar to those found on somedigital cameras and camcorders. The color display 5 is a major costelement of these versions of Artcam, and the display 5 plus back lightare a major power consumption drain.

[0381] Status Display 15

[0382] The status display 15 is a small passive segment based LCD,similar to those currently provided on silver halide and digitalcameras. Its main function is to show the number of prints remaining inthe print roll 42 and icons for various standard camera features, suchas flash and battery status.

[0383] Color Display 5

[0384] The color display 5 is a full motion image display which operatesas a viewfinder, as a verification of the image to be printed, and as auser interface display. The cost of the display 5 is approximatelyproportional to its area, so large displays (say 4″ diagonal) unit willbe restricted to expensive versions of the Artcam unit. Smallerdisplays, such as color camcorder viewfinder TFT's at around 1″, may beeffective for mid-range Artcams.

[0385] Zoom Lens (Not Shown)

[0386] The Artcam can include a zoom lens. This can be a standardelectronically controlled zoom lens, identical to one which would beused on a standard electronic camera, and similar to pocket camera zoomlenses. A referred version of the Artcam unit may include standardinterchangeable 35 mm SLR lenses.

[0387] Autofocus Motor 39

[0388] The autofocus motor 39 changes the focus of the zoom lens. Themotor is a miniature motor geared down to an appropriate speed to drivethe autofocus mechanism.

[0389] Autofocus Motor Driver 63

[0390] The autofocus motor driver 63 is a small circuit which amplifiesthe digital motor control signals from the APC 31 to levels suitable fordriving the motor 39.

[0391] Zoom Motor 38

[0392] The zoom motor 38 moves the zoom front lenses in and out. Themotor is a miniature motor geared down to an appropriate speed to drivethe zoom mechanism.

[0393] Zoom Motor Driver 62

[0394] The zoom motor driver 62 is a small circuit which amplifies thedigital motor control signals from the APC 31 to levels suitable fordriving the motor.

[0395] Communications

[0396] The ACP 31 contains a universal serial bus (USB) interface 52 forcommunication with personal computers. Not all Artcam models areintended to include the USB connector. However, the silicon arearequired for a USB circuit 52 is small, so the interface can be includedin the standard ACP.

[0397] Optional Keyboard 57

[0398] The Artcam unit may include an optional miniature keyboard 57 forcustomizing text specified by the Artcard. Any text appearing in anArtcard image may be editable, even if it is in a complex metallic 3Dfont. The miniature keyboard includes a single line alphanumeric LCD todisplay the original text and edited text. The keyboard may be astandard accessory.

[0399] The ACP 31 contains a serial communications circuit fortransferring data to and from the miniature keyboard.

[0400] Power Supply

[0401] The Artcam unit uses a battery 48. Depending upon the Artcamoptions, this is either a 3V Lithium cell, 1.5 V AA alkaline cells, orother battery arrangement.

[0402] Power Management Unit 51

[0403] Power consumption is an important design constraint in theArtcam. It is desirable that either standard camera batteries (such as3V lithium batters) or standard AA or AAA alkaline cells can be used.While the electronic complexity of the Artcam unit is dramaticallyhigher than 35 mm photographic cameras, the power consumption need notbe commensurately higher. Power in the Artcam can be carefully managedwith all unit being turned off when not in use.

[0404] The most significant current drains are the ACP 31, the areaimage sensors 2,4, the printer 44 various motors, the flash unit 56, andthe optional color display 5 dealing with each part separately:

[0405] 1. ACP: If fabricated using 0.25 μm CMOS, and running on 1.5V,the ACP power consumption can be quite low. Clocks to various parts ofthe ACP chip can be quite low. Clocks to various parts of the ACP chipcan be turned off when not in use, virtually eliminating standby currentconsumption. The ACP will only fully used for approximately 4 secondsfor each photograph printed.

[0406] 2. Area image sensor: power is only supplied to the area imagesensor when the user has their finger on the button.

[0407] 3. The printer power is only supplied to the printer whenactually printing. This is for around 2 seconds for each photograph.Even so, suitably lower power consumption printing should be used.

[0408] 4. The motors required in the Artcam are all low power miniaturemotors, and are typically only activated for a few seconds per photo.

[0409] 5. The flash unit 45 is only used for some photographs. Its powerconsumption can readily be provided by a 3V lithium battery for areasonably battery life.

[0410] 6. The optional color display 5 is a major current drain for tworeasons: it must be on for the whole time that the camera is in use, anda backlight will be required if a liquid crystal display is used.Cameras which incorporate a color display will require a larger batteryto achieve acceptable batter life.

[0411] Flash Unit 56

[0412] The flash unit 56 can be a standard miniature electronic flashfor consumer cameras.

[0413] Overview of the ACP 31

[0414]FIG. 3 illustrates the Artcam Central Processor (ACP) 31 in moredetail. The Artcam Central Processor provides all of the processingpower for Artcam. It is designed for a 0.25 micron CMOS process, withapproximately 1.5 million transistors and an area of around 50 mm². TheACP 31 is a complex design, but design effort can be reduced by the useof datapath compilation techniques, macrocells, and IP cores. The ACP 31contains:

[0415] A RISC CPU core 72

[0416] A 4 way parallel VLIW Vector Processor 74

[0417] A Direct RAMbus interface 81

[0418] A CMOS image sensor interface 83

[0419] A CMOS linear image sensor interface 88

[0420] A USB serial interface 52

[0421] An infrared keyboard interface 55

[0422] A numeric LCD interface 84, and

[0423] A color TFT LCD interface 88

[0424] A 4 Mbyte Flash memory 70 for program storage 70

[0425] The RISC CPU, Direct RAMbus interface 81, CMOS sensor interface83 and USB serial interface 52 can be vendor supplied cores. The ACP 31is intended to run at a clock speed of 200 MHz on 3V externally and 1.5Vinternally to minimize power consumption. The CPU core needs only to runat 100 MHz. The following two block diagrams give two views of the ACP31:

[0426] A View of the ACP 31 in Isolation

[0427] An example Artcam showing a high-level view of the ACP 31connected to the rest of the Artcam hardware.

[0428] Image Access

[0429] As stated previously, the DRAM Interface 81 is responsible forinterfacing between other client portions of the ACP chip and the RAMBUSDRAM. In effect, each module within the DRAM Interface is an addressgenerator.

[0430] There are three logical types of images manipulated by the ACP.They are:

[0431] CCD Image, which is the Input Image captured from the CCD.

[0432] Internal Image format—the Image format utilised internally by theArtcam device.

[0433] Print Image—the Output Image Format Printed by the Artcam

[0434] These images are typically different in color space, resolution,and the output & input color spaces which can vary from camera tocamera. For example, a CCD image on a low-end camera may be a differentresolution, or have different color characteristics from that used in ahigh-end camera. However all internal image formats are the same formatin terms of color space across all cameras.

[0435] In addition, the three image types can vary with respect to whichdirection is ‘up’. The physical orientation of the camera causes thenotion of a portrait or landscape image, and this must be maintainedthroughout processing. For this reason, the internal image is alwaysoriented correctly, and rotation is performed on images obtained fromthe CCD and during the print operation.

[0436] CPU Core (CPU) 72

[0437] The ACP 31 incorporates a 32 bit RISC CPU 72 to run the Varkimage processing language interpreter and to perform Artcam's generaloperating system duties. A wide variety of CPU cores are suitable: itcan be any processor core with sufficient processing power to performthe required core calculations and control functions fast enough to metconsumer expectations. Examples of suitable cores are: MIPS R4000 corefrom LSI Logic, StrongARM core. There is no need to maintain instructionset continuity between different Artcam models. Artcard compatibility ismaintained irrespective of future processor advances and changes,because the Vark interpreter is simply re-compiled for each newinstruction set. The ACP 31 architecture is therefore also free toevolve. Different ACP 31 chip designs may be fabricated by differentmanufacturers, without requiring to license or port the CPU core. Thisdevice independence avoids the chip vendor lock-in such as has occurredin the PC market with Intel. The CPU operates at 100 MHz, with a singlecycle time of 10 ns. It must be fast enough to run the Vark interpreter,although the VLIW Vector Processor 74 is responsible for most of thetime-critical operations.

[0438] Program Cache 72

[0439] Although the program code is stored in on-chip Flash memory 70,it is unlikely that well packed Flash memory 70 will be able to operateat the 10 ns cycle time required by the CPU. Consequently a small cacheis required for good performance. 16 cache lines of 32 bytes each aresufficient, for a total of 512 bytes. The program cache 72 is defined inthe chapter entitled Program cache 72.

[0440] Data Cache 76

[0441] A small data cache 76 is required for good performance. Thisrequirement is mostly due to the use of a RAMbus DRAM, which can providehigh-speed data in bursts, but is inefficient for single byte accesses.The CPU has access to a memory caching system that allows flexiblemanipulation of CPU data cache 76 sizes. A minimum of 16 cache lines(512 bytes) is recommended for good performance.

[0442] CPU Memory Model

[0443] An Artcam's CPU memory model consists of a 32 MB area. Itconsists of 8 MB of physical RDRAM off-chip in the base model of Artcam,with provision for up to 16 MB of off-chip memory. There is a 4 MB Flashmemory 70 on the ACP 31 for program storage, and finally a 4 MB addressspace mapped to the various registers and controls of the ACP 31. Thememory map then, for an Artcam is as follows: Contents Size Base ArtcamDRAM 8 MB Extended DRAM 8 MB Program memory (on ACP 31 in Flash 4 MBmemory 70) Reserved for extension of program memory 4 MB ACP 31registers and memory-mapped I/O 4 MB Reserved 4 MB TOTAL 32 MB 

[0444] A straightforward way of decoding addresses is to use addressbits 23-24:

[0445] If bit 24 is clear, the address is in the lower 16-MB range, andhence can be satisfied from DRAM and the Data cache 76. In most casesthe DRAM will only be 8 MB, but 16 MB is allocated to cater for a highermemory model Artcams.

[0446] If bit 24 is set, and bit 23 is clear, then the addressrepresents the Flash memory 70 4 Mbyte range and is satisfied by theProgram cache 72.

[0447] If bit 24=1 and bit 23=1, the address is translated into anaccess over the low speed bus to the requested component in the AC bythe CPU Memory Decoder 68.

[0448] Flash Memory 70

[0449] The ACP 31 contains a 4 Mbyte Flash memory 70 for storing theArtcam program. It is envisaged that Flash memory 70 will have denserpacking coefficients than masked ROM, and allows for greater flexibilityfor testing camera program code. The downside of the Flash memory 70 isthe access time, which is unlikely to be fast enough for the 100 MHzoperating speed (10 ns cycle time) of the CPU. A fast ProgramInstruction cache 77 therefore acts as the interface between the CPU andthe slower Flash memory 70.

[0450] Program Cache 72

[0451] A small cache is required for good CPU performance. Thisrequirement is due to the slow speed Flash memory 70 which stores theProgram code. 16 cache lines of 32 bytes each are sufficient, for atotal of 512 bytes. The Program cache 72 is a read only cache. The dataused by CPU programs comes through the CPU Memory Decoder 68 and if theaddress is in DRAM, through the general Data cache 76. The separationallows the CPU to operate independently of the VLIW Vector Processor 74.If the data requirements are low for a given process, it canconsequently operate completely out of cache.

[0452] Finally, the Program cache 72 can be read as data by the CPUrather than purely as program instructions. This allows tables,microcode for the VLIW etc to be loaded from the Flash memory 70.Addresses with bit 24 set and bit 23 clear are satisfied from theProgram cache 72.

[0453] CPU Memory Decoder 68

[0454] The CPU Memory Decoder 68 is a simple decoder for satisfying CPUdata accesses. The Decoder translates data addresses into internal ACPregister accesses over the internal low speed bus, and therefore allowsfor memory mapped I/O of ACP registers. The CPU Memory Decoder 68 onlyinterprets addresses that have bit 24 set and bit 23 clear. There is nocaching in the CPU Memory Decoder 68.

[0455] DRAM Interface 81

[0456] The DRAM used by the Artcam is a single channel 64 Mbit (8 MB)RAMbus RDRAM operating at 1.6 GB/sec. RDRAM accesses are by a singlechannel (16-bit data path) controller. The RDRAM also has several usefuloperating modes for low power operation. Although the Rambusspecification describes a system with random 32 byte transfers ascapable of achieving a greater than 95% efficiency, this is not true ifonly part of the 32 bytes are used. Two reads followed by two writes tothe same device yields over 86% efficiency. The primary latency isrequired for bus turn-around going from a Write to a Read, and sincethere is a Delayed Write mechanism, efficiency can be further improved.With regards to writes, Write Masks allow specific subsets of bytes tobe written to. These write masks would be set via internal cache “dirtybits”. The upshot of the Rambus Direct RDRAM is a throughput of >1GB/sec is easily achievable, and with multiple reads for every write(most processes) combined with intelligent algorithms making good use of32 byte transfer knowledge, transfer rates of >1.3 GB/sec are expected.Every 10 ns, 16 bytes can be transferred to or from the core.

[0457] DRAM Organization

[0458] The DRAM organization for a base model (8 MB RDRAM) Artcam is asfollows: Contents Size Program scratch RAM 0.50 MB Artcard data 1.00 MBPhoto Image, captured from CMOS Sensor 0.50 MB Print Image (compressed)2.25 MB 1 Channel of expanded Photo Image 1.50 MB 1 Image Pyramid ofsingle channel 1.00 MB Intermediate Image Processing 1.25 MB TOTAL   8MB

[0459] Notes:

[0460] Uncompressed, the Print Image requires 4.5 MB (1.5 MB perchannel). To accommodate other objects in the 8 MB model, the PrintImage needs to be compressed. If the chrominance channels are compressedby 4:1 they require only 0.375 MB each).

[0461] The memory model described here assumes a single 8 MB RDRAM.Other models of the Artcam may have more memory, and thus not requirecompression of the Print Image. In addition, with more memory a largerpart of the final image can be worked on at once, potentially giving aspeed improvement.

[0462] Note that ejecting or inserting an Artcard invalidates the 5.5 MBarea holding the Print Image, 1 channel of expanded photo image, and theimage pyramid. This space may be safely used by the Artcard Interfacefor decoding the Artcard data.

[0463] Data Cache 76

[0464] The ACP 31 contains a dedicated CPU instruction cache 77 and ageneral data cache 76. The Data cache 76 handles all DRAM requests(reads and writes of data) from the CPU, the VLIW Vector Processor 74,and the Display Controller 88. These requests may have very differentprofiles in terms of memory usage and algorithmic timing requirements.For example, a VLIW process may be processing an image in linear memory,and lookup a value in a table for each value in the image. There islittle need to cache much of the image, but it may be desirable to cachethe entire lookup table so that no real memory access is required.Because of these differing requirements, the Data cache 76 allows for anintelligent definition of caching.

[0465] Although the Rambus DRAM interface 81 is capable of veryhigh-speed memory access (an average throughput of 32 bytes in 25 ns),it is not efficient dealing with single byte requests. In order toreduce effective memory latency, the ACP 31 contains 128 cache lines.Each cache line is 32 bytes wide. Thus the total amount of data cache 76is 4096 bytes (4 KB). The 128 cache lines are configured into 16programmable-sized groups. Each of the 16 groups must be a contiguousset of cache lines. The CPU is responsible for determining how manycache lines to allocate to each group. Within each group cache lines arefilled according to a simple Least Recently Used algorithm. In terms ofCPU data requests, the Data cache 76 handles memory access requests thathave address bit 24 clear. If bit 24 is clear, the address is in thelower 16 MB range, and hence can be satisfied from DRAM and the Datacache 76. In most cases the DRAM will only be 8 MB, but 16 MB isallocated to cater for a higher memory model Artcam. If bit 24 is set,the address is ignored by the Data cache 76.

[0466] All CPU data requests are satisfied from Cache Group 0. A minimumof 16 cache lines is recommended for good CPU performance, although theCPU can assign any number of cache lines (except none) to Cache Group 0.The remaining Cache Groups (1 to 15) are allocated according to thecurrent requirements. This could mean allocation to a VLIW VectorProcessor 74 program or the Display Controller 88. For example, a 256byte lookup table required to be permanently available would require 8cache lines. Writing out a sequential image would only require 2-4 cachelines (depending on the size of record being generated and whether writerequests are being Write Delayed for a significant number of cycles).Associated with each cache line byte is a dirty bit, used for creating aWrite Mask when writing memory to DRAM. Associated with each cache lineis another dirty bit, which indicates whether any of the cache linebytes has been written to (and therefore the cache line must be writtenback to DRAM before it can be reused). Note that it is possible for twodifferent Cache Groups to be accessing the same address in memory and toget out of sync. The VLIW program writer is responsible to ensure thatthis is not an issue. It could be perfectly reasonable, for example, tohave a Cache Group responsible for reading an image, and another CacheGroup responsible for writing the changed image back to memory again. Ifthe images are read or written sequentially there may be advantages inallocating cache lines in this manner. A total of 8 buses 182 connectthe VLIW Vector Processor 74 to the Data cache 76. Each bus is connectedto an I/O Address Generator. (There are 2 I/O Address Generators 189,190 per Processing Unit 178, and there are 4 Processing Units in theVLIW Vector Processor 74. The total number of buses is therefore 8.)

[0467] In any given cycle, in addition to a single 32 bit (4 byte)access to the CPU's cache group (Group 0), 4 simultaneous accesses of 16bits (2 bytes) to remaining cache groups are permitted on the 8 VLIWVector Processor 74 buses. The Data cache 76 is responsible for fairlyprocessing the requests. On a given cycle, no more than 1 request to aspecific Cache Group will be processed. Given that there are 8 AddressGenerators 189, 190 in the VLIW Vector Processor 74, each one of thesehas the potential to refer to an individual Cache Group. However it ispossible and occasionally reasonable for 2 or more Address Generators189, 190 to access the same Cache Group. The CPU is responsible forensuring that the Cache Groups have been allocated the correct number ofcache lines, and that the various Address Generators 189, 190 in theVLIW Vector Processor 74 reference the specific Cache Groups correctly.

[0468] The Data cache 76 as described allows for the Display Controller88 and VLIW Vector Processor 74 to be active simultaneously. If theoperation of these two components were deemed to never occursimultaneously, a total 9 Cache Groups would suffice. The CPU would useCache Group 0, and the VLIW Vector Processor 74 and the DisplayController 88 would share the remaining 8 Cache Groups, requiring only 3bits (rather than 4) to define which Cache Group would satisfy aparticular request.

[0469] JTAG Interface 85

[0470] A standard JTAG (Joint Test Action Group) Interface is includedin the ACP 31 for testing purposes. Due to the complexity of the chip, avariety of testing techniques are required, including BIST (Built InSelf Test) and functional block isolation. An overhead of 10% in chiparea is assumed for overall chip testing circuitry. The test circuitryis beyond the scope of this document.

[0471] Serial Interfaces

[0472] USB Serial Port Interface 52

[0473] This is a standard USB serial port, which is connected to theinternal chip low speed bus, thereby allowing the CPU to control it.

[0474] Keyboard Interface 65

[0475] This is a standard low-speed serial port, which is connected tothe internal chip low speed bus, thereby allowing the CPU to control it.It is designed to be optionally connected to a keyboard to allow simpledata input to customize prints.

[0476] Authentication Chip Serial Interfaces 64

[0477] These are 2 standard low-speed serial ports, which are connectedto the internal chip low speed bus, thereby allowing the CPU to controlthem. The reason for having 2 ports is to connect to both the on-cameraAuthentication chip, and to the print-roll Authentication chip usingseparate lines. Only using 1 line may make it possible for a cloneprint-roll manufacturer to design a chip which, instead of generating anauthentication code, tricks the camera into using the code generated bythe authentication chip in the camera.

[0478] Parallel Interface 67

[0479] The parallel interface connects the ACP 31 to individual staticelectrical signals. The CPU is able to control each of these connectionsas memory-mapped I/O via the low speed bus The following table is a listof connections to the parallel interface: Connection Direction PinsPaper transport stepper motor Out 4 Artcard stepper motor Out 4 Zoomstepper motor Out 4 Guillotine motor Out 1 Flash trigger Out 1 StatusLCD segment drivers Out 7 Status LCD common drivers Out 4 Artcardillumination LED Out 1 Artcard status LED (red/green) In 2 Artcardsensor In 1 Paper pull sensor In 1 Orientation sensor In 2 Buttons In 4TOTAL 36

[0480] VLIW Input and Output FIFOs 78, 79

[0481] The VLIW Input and Output FIFOs are 8 bit wide FIFOs used forcommunicating between processes and the VLIW Vector Processor 74. BothFIFOs are under the control of the VLIW Vector Processor 74, but can becleared and queried (e.g. for status) etc by the CPU.

[0482] VLIW Input FIFO 78

[0483] A client writes 8-bit data to the VLIW Input FIFO 78 in order tohave the data processed by the VLIW Vector Processor 74. Clients includethe Image Sensor Interface, Artcard Interface, and CPU. Each of theseprocesses is able to offload processing by simply writing the data tothe FIFO, and letting the VLIW Vector Processor 74 do all the hard work.An example of the use of a client's use of the VLIW Input FIFO 78 is theImage Sensor Interface (ISI 83). The ISI 83 takes data from the ImageSensor and writes it to the FIFO. A VLIW process takes it from the FIFO,transforming it into the correct image data format, and writing it outto DRAM. The ISI 83 becomes much simpler as a result.

[0484] VLIW Output FIFO 79

[0485] The VLIW Vector Processor 74 writes 8-bit data to the VLIW OutputFIFO 79 where clients can read it. Clients include the Print HeadInterface and the CPU. Both of these clients is able to offloadprocessing by simply reading the already processed data from the FIFO,and letting the VLIW Vector Processor 74 do all the hard work. The CPUcan also be interrupted whenever data is placed into the VLIW OutputFIFO 79, allowing it to only process the data as it becomes availablerather than polling the FIFO continuously. An example of the use of aclient's use of the VLIW Output FIFO 79 is the Print Head Interface (PHI62). A VLIW process takes an image, rotates it to the correctorientation, color converts it, and dithers the resulting imageaccording to the print head requirements. The PHI 62 reads the ditheredformatted 8-bit data from the VLIW Output FIFO 79 and simply passes iton to the Print Head external to the ACP 31. The PHI 62 becomes muchsimpler as a result.

[0486] VLIW Vector Processor 74

[0487] To achieve the high processing requirements of Artcam, the ACP 31contains a VLIW (Very Long Instruction Word) Vector Processor. The VLIWprocessor is a set of 4 identical Processing Units (PU e.g 178) workingin parallel, connected by a crossbar switch 183. Each PU e.g 178 canperform four 8-bit multiplications, eight 8-bit additions, three 32-bitadditions, I/O processing, and various logical operations in each cycle.The PUs e.g 178 are microcoded, and each has two Address Generators 189,190 to allow full use of available cycles for data processing. The fourPUs e.g 178 are normally synchronized to provide a tightly interactingVLIW processor. Clocking at 200 MHz, the VLIW Vector Processor 74 runsat 12 Gops (12 billion operations per second). Instructions are tunedfor image processing functions such as warping, artistic brushing,complex synthetic illumination, color transforms, image filtering, andcompositing. These are accelerated by two orders of magnitude overdesktop computers. As shown in more detail in FIG. 3(a), the VLIW VectorProcessor 74 is 4 PUs e.g 178 connected by a crossbar switch 183 suchthat each PU e.g 178 provides two inputs to, and takes two outputs from,the crossbar switch 183. Two common registers form a control andsynchronization mechanism for the PUs e.g 178. 8 Cache buses 182 allowconnectivity to DRAM via the Data cache 76, with 2 buses going to eachPU e.g 178 (1 bus per I/O Address Generator). Each PU e.g 178 consistsof an ALU 188 (containing a number of registers & some arithmetic logicfor processing data), some microcode RAM 196, and connections to theoutside world (including other ALUs). A local PU state machine runs inmicrocode and is the means by which the PU e.g 178 is controlled. EachPU e.g 178 contains two I/O Address Generators 189, 190 controlling dataflow between DRAM (via the Data cache 76) and the ALU 188 (via InputFIFO and Output FIFO). The address generator is able to read and writedata (specifically images in a variety of formats) as well as tables andsimulated FIFOs in DRAM. The formats are customizable under softwarecontrol, but are not microcoded. Data taken from the Data cache 76 istransferred to the ALU 188 via the 16-bit wide Input FIFO. Output datais written to the 16-bit wide Output FIFO and from there to the Datacache 76. Finally, all PUs e.g 178 share a single 8-bit wide VLIW InputFIFO 78 and a single 8-bit wide VLIW Output FIFO 79. The low speed databus connection allows the CPU to read and write registers in the PU e.g178, update microcode, as well as the common registers shared by all PUse.g 178 in the VLIW Vector Processor 74. Turning now to FIG. 4, a closerdetail of the internals of a single PU e.g 178 can be seen, withcomponents and control signals detailed in subsequent hereinafter:

[0488] Microcode

[0489] Each PU e.g 178 contains a microcode RAM 196 to hold the programfor that particular PU e.g 178. Rather than have the microcode in ROM,the microcode is in RAM, with the CPU responsible for loading it up. Forthe same space on chip, this tradeoff reduces the maximum size of anyone function to the size of the RAM, but allows an unlimited number offunctions to be written in microcode. Functions implemented usingmicrocode include Vark acceleration, Artcard reading, and Printing. TheVLIW Vector Processor 74 scheme has several advantages for the case ofthe ACP 31:

[0490] Hardware design complexity is reduced

[0491] Hardware risk is reduced due to reduction in complexity

[0492] Hardware design time does not depend on all Vark functionalitybeing implemented in dedicated silicon

[0493] Space on chip is reduced overall (due to large number ofprocesses able to be implemented as microcode)

[0494] Functionality can be added to Vark (via microcode) with no impacton hardware design time

[0495] Size and Content

[0496] The CPU loaded microcode RAM 196 for controlling each PU e.g 178is 128 words, with each word being 96 bits wide. A summary of themicrocode size for control of various units of the PU e.g 178 is listedin the following table: Process Block Size (bits) Status Output 3Branching (microcode 11 control) In 8 Out 6 Registers 7 Read 10 Write 6Barrel Shifter 12 Adder/Logical 14 Multiply/Interpolate 19 TOTAL 96

[0497] With 128 instruction words, the total microcode RAM 196 per PUe.g 178 is 12,288 bits, or 1.5 KB exactly. Since the VLIW VectorProcessor 74 consists of 4 identical PUs e.g 178 this equates to 6,144bytes, exactly 6 KB. Some of the bits in a microcode word are directlyused as control bits, while others are decoded. See the various unitdescriptions that detail the interpretation of each of the bits of themicrocode word.

[0498] Synchronization Between PUs e.g 178

[0499] Each PU e.g 178 contains a 4 bit Synchronization Register 197. Itis a mask used to determine which PUs e.g 178 work together, and has onebit set for each of the corresponding PUs e.g 178 that are functioningas a single process. For example, if all of the PUs e.g 178 werefunctioning as a single process, each of the 4 Synchronization Register197s would have all 4 bits set. If there were two asynchronous processesof 2 PUs e.g 178 each, two of the PUs e.g 178 would have 2 bits set intheir Synchronization Register 197s (corresponding to themselves), andthe other two would have the other 2 bits set in their SynchronizationRegister 197s (corresponding to themselves).

[0500] The Synchronization Register 197 is used in two basic ways:

[0501] Stopping and starting a given process in synchrony

[0502] Suspending execution within a process

[0503] Stopping and Starting Processes

[0504] The CPU is responsible for loading the microcode RAM 196 andloading the execution address for the first instruction (usually 0).When the CPU starts executing microcode, it begins at the specifiedaddress.

[0505] Execution of microcode only occurs when all the bits of theSynchronization Register 197 are also set in the Common SynchronizationRegister 197. The CPU therefore sets up all the PUs e.g 178 and thenstarts or stops processes with a single write to the CommonSynchronization Register 197.

[0506] This synchronization scheme allows multiple processes to berunning asynchronously on the PUs e.g 178, being stopped and started asprocesses rather than one PU e.g 178 at a time.

[0507] Suspending Execution within a Process

[0508] In a given cycle, a PU e.g 178 may need to read from or write toa FIFO (based on the opcode of the current microcode instruction). Ifthe FIFO is empty on a read request, or full on a write request, theFIFO request cannot be completed. The PU e.g 178 will therefore assertits SuspendProcess control signal 198. The SuspendProcess signals fromall PUs e.g 178 are fed back to all the PUs e.g 178. The SynchronizationRegister 197 is ANDed with the 4 SuspendProcess bits, and if the resultis non-zero, none of the PU e.g 178's register WriteEnables or FIFOstrobes will be set. Consequently none of the PUs e.g 178 that form thesame process group as the PU e.g 178 that was unable to complete itstask will have their registers or FIFOs updated during that cycle. Thissimple technique keeps a given process group in synchronization. Eachsubsequent cycle the PU e.g 178's state machine will attempt tore-execute the microcode instruction at the same address, and willcontinue to do so until successful. Of course the Common SynchronizationRegister 197 can be written to by the CPU to stop the entire process ifnecessary. This synchronization scheme allows any combinations of PUse.g 178 to work together, each group only affecting its co-workers withregards to suspension due to data not being ready for reading orwriting.

[0509] Control and Branching

[0510] During each cycle, each of the four basic input and calculationunits within a PU e.g 178's ALU 188 (Read, Adder/Logic,Multiply/Interpolate, and Barrel Shifter) produces two status bits: aZero flag and a Negative flag indicating whether the result of theoperation during that cycle was 0 or negative. Each cycle one of those 4status bits is chosen by microcode instructions to be output from the PUe.g 178. The 4 status bits (1 per PU e.g 178's ALU 188) are combinedinto a 4 bit Common Status Register 200. During the next cycle, each PUe.g 178's microcode program can select one of the bits from the CommonStatus Register 200, and branch to another microcode address dependanton the value of the status bit.

[0511] Status Bit

[0512] Each PU e.g 178's ALU 188 contains a number of input andcalculation units. Each unit produces 2 status bits—a negative flag anda zero flag. One of these status bits is output from the PU e.g 178 whena particular unit asserts the value on the 1-bit tri-state status bitbus. The single status bit is output from the PU e.g 178, and thencombined with the other PU e.g 178 status bits to update the CommonStatus Register 200. The microcode for determining the output status bittakes the following form: # Bits Description 2 Select unit whose statusbit is to be output 00 = Adder unit 01 = Multiply/Logic unit 10 = BarrelShift unit 11 = Reader unit 1  0 = Zero flag  1 = Negative flag 3 TOTAL

[0513] Within the ALU 188, the 2-bit Select Processor Block value isdecoded into four 1-bit enable bits, with a different enable bit sent toeach processor unit block. The status select bit (choosing Zero orNegative) is passed into all units to determine which bit is to beoutput onto the status bit bus.

[0514] Branching within Microcode

[0515] Each PU e.g 178 contains a 7 bit Program Counter (PC) that holdsthe current microcode address being executed. Normal program executionis linear, moving from address N in one cycle to address N+1 in the nextcycle. Every cycle however, a microcode program has the ability tobranch to a different location, or to test a status bit from the CommonStatus Register 200 and branch. The microcode for determining the nextexecution address takes the following form: # Bits Description 2 00 =NOP (PC = PC + 1) 01 = Branch always 10 = Branch if status bit clear 11= Branch if status bit set 2 Select status bit from status word 7Address to branch to (absolute address, 00-7F) 11 TOTAL

[0516] ALU 188

[0517]FIG. 5 illustrates the ALU 188 in more detail. Inside the ALU 188are a number of specialized processing blocks, controlled by a microcodeprogram. The specialized processing blocks include:

[0518] Read Block 202, for accepting data from the input FIFOs

[0519] Write Block 203, for sending data out via the output FIFOs

[0520] Adder/Logical block 204, for addition & subtraction, comparisonsand logical operations

[0521] Multiply/Interpolate block 205, for multiple types ofinterpolations and multiply/accumulates

[0522] Barrel Shift block 206, for shifting data as required

[0523] In block 207, for accepting data from the external crossbarswitch 183

[0524] Out block 208, for sending data to the external crossbar switch183

[0525] Registers block 215, for holding data in temporary storage

[0526] Four specialized 32 bit registers hold the results of the 4 mainprocessing blocks:

[0527] M register 209 holds the result of the Multiply/Interpolate block

[0528] L register 209 holds the result of the Adder/Logic block

[0529] S register 209 holds the result of the Barrel Shifter block

[0530] R register 209 holds the result of the Read Block 202

[0531] In addition there are two internal crossbar switches 213 m 214for data transport. The various process blocks are further expanded inthe following sections, together with the microcode definitions thatpertain to each block. Note that the microcode is decoded within a blockto provide the control signals to the various units within.

[0532] Data Transfers Between PUs e.g 178

[0533] Each PU e.g 178 is able to exchange data via the externalcrossbar. A PU e.g 178 takes two inputs and outputs two values to theexternal crossbar. In this way two operands for processing can beobtained in a single cycle, but cannot be actually used in an operationuntil the following cycle.

[0534] In 207

[0535] This block is illustrated in FIG. 6 and contains two registers,In₁ and In₂ that accept data from the external crossbar. The registerscan be loaded each cycle, or can remain unchanged. The selection bitsfor choosing from among the 8 inputs are output to the external crossbarswitch 183. The microcode takes the following form: # Bits Description 10 = NOP 1 = Load In₁ from crossbar 3 Select Input 1 from externalcrossbar 1 0 = NOP 1 = Load In₂ from crossbar 3 Select Input 2 fromexternal crossbar 8 TOTAL

[0536] Out 208

[0537] Complementing In is Out 208. The Out block is illustrated in moredetail in FIG. 7. Out contains two registers, Out₁ and Out₂, both ofwhich are output to the external crossbar each cycle for use by otherPUs e.g 178. The Write unit is also able to write one of Out₁ or Out₂ toone of the output FIFOs attached to the ALU 188. Finally, both registersare available as inputs to Crossbar1 213, which therefore makes theregister values available as inputs to other units within the ALU 188.Each cycle either of the two registers can be updated according tomicrocode selection. The data loaded into the specified register can beone of D₀-D₃ (selected from Crossbar1 213) one of M, L, S, and R(selected from Crossbar2 214), one of 2 programmable constants, or thefixed values 0 or 1. The microcode for Out takes the following form: #Bits Description 1 0 = NOP 1 = Load Register 1 Select Register to load[Out₁ or Out₂] 4 Select input [In₁, In₂, Out₁, Out₂, D₀, D₁, D₂, D₃, M,L, S, R, K₁, K₂, 0, 1] 6 TOTAL

[0538] Local Registers and Data Transfers within ALU 188

[0539] As noted previously, the ALU 188 contains four specialized 32-bitregisters to hold the results of the 4 main processing blocks:

[0540] M register 209 holds the result of the Multiply/Interpolate block

[0541] L register 209 holds the result of the Adder/Logic block

[0542] S register 209 holds the result of the Barrel Shifter block

[0543] R register 209 holds the result of the Read Block 202

[0544] The CPU has direct access to these registers, and other units canselect them as inputs via Crossbar2 214. Sometimes it is necessary todelay an operation for one or more cycles. The Registers block containsfour 32-bit registers D₀-D₃ to hold temporary variables duringprocessing. Each cycle one of the registers can be updated, while allthe registers are output for other units to use via Crossbar1 213 (whichalso includes In₁, In₂, Out₁ and Out₂). The CPU has direct access tothese registers. The data loaded into the specified register can be oneof D₀-D₃ (selected from Crossbar1 213) one of M, L, S, and R (selectedfrom Crossbar2 214), one of 2 programmable constants, or the fixedvalues 0 or 1. The Registers block 215 is illustrated in more detail inFIG. 8. The microcode for Registers takes the following form: # BitsDescription 1 0 = NOP 1 = Load Register 2 Select Register to load[D₀-D₃] 4 Select input [In₁, In₂, Out₁, Out₂, D₀, D₁, D₂, D₃, M, L, S,R, K₁, K₂, 0, 1] 7 TOTAL

[0545] Crossbar1 213

[0546] Crossbar1 213 is illustrated in more detail in FIG. 9. Crossbar1213 is used to select from inputs In₁, In₂, Out₁, Out₂, D₀-D₃. 7 outputsare generated from Crossbar1 213: 3 to the Multiply/Interpolate Unit, 2to the Adder Unit, 1 to the Registers unit and 1 to the Out unit. Thecontrol signals for Crossbar1 213 come from the various units that usethe Crossbar inputs. There is no specific microcode that is separate forCrossbar1 213.

[0547] Crossbar2 214

[0548] Crossbar2 214 is illustrated in more detail in FIG. 10. Crossbar2214 is used to select from the general ALU 188 registers M, L, S and R.6 outputs are generated from Crossbar1 213: 2 to theMultiply/Interpolate Unit, 2 to the Adder Unit, 1 to the Registers unitand 1 to the Out unit. The control signals for Crossbar2 214 come fromthe various units that use the Crossbar inputs. There is no specificmicrocode that is separate for Crossbar2 214.

[0549] Data Transfers Between PUs e.g 178 and DRAM or External Processes

[0550] Returning to FIG. 4, PUs e.g 178 share data with each otherdirectly via the external crossbar. They also transfer data to and fromexternal processes as well as DRAM. Each PU e.g 178 has 2 I/O AddressGenerators 189, 190 for transferring data to and from DRAM. A PU e.g 178can send data to DRAM via an I/O Address Generator's Output FIFO e.g.186, or accept data from DRAM via an I/O Address Generator's Input FIFO187. These FIFOs are local to the PU e.g 178. There is also a mechanismfor transferring data to and from external processes in the form of acommon VLIW Input FIFO 78 and a common VLIW Output FIFO 79, sharedbetween all ALUs. The VLIW Input and Output FIFOs are only 8 bits wide,and are used for printing, Artcard reading, transferring data to the CPUetc. The local Input and Output FIFOs are 16 bits wide.

[0551] Read

[0552] The Read process block 202 of FIG. 5 is responsible for updatingthe ALU 188's R register 209, which represents the external input datato a VLIW microcoded process. Each cycle the Read Unit is able to readfrom either the common VLIW Input FIFO 78 (8 bits) or one of two localInput FIFOs (16 bits). A 32-bit value is generated, and then all or partof that data is transferred to the R register 209. The process can beseen in FIG. 11. The microcode for Read is described in the followingtable. Note that the interpretations of some bit patterns aredeliberately chosen to aid decoding. # Bits Description 2 00 = NOP 01 =Read from VLIW Input FIFO 78 10 = Read from Local FIFO 1 11 = Read fromLocal FIFO 2 1 How many significant bits 0 = 8 bits (pad with 0 or signextend) 1 = 16 bits (only valid for Local FIFO reads) 1 0 = Treat dataas unsigned (pad with 0) 1 = Treat data as signed (sign extend whenreading from FIFO)r 2 How much to shift data left by: 00 = 0 bits (nochange) 01 = 8 bits 10 = 16 bits 11 = 24 bits 4 Which bytes of R toupdate (hi to lo order byte) Each of the 4 bits represents 1 byteWriteEnable on R 10 TOTAL

[0553] Write

[0554] The Write process block is able to write to either the commonVLIW Output FIFO 79 or one of the two local Output FIFOs each cycle.Note that since only 1 FIFO is written to in a given cycle, only one16-bit value is output to all FIFOs, with the low 8 bits going to theVLIW Output FIFO 79. The microcode controls which of the FIFOs gates inthe value. The process of data selection can be seen in more detail inFIG. 12. The source values Out₁ and Out₂ come from the Out block. Theyare simply two registers. The microcode for Write takes the followingform: # Bits Description 2 00 = NOP 01 = Write VLIW Output FIFO 79 10 =Write local Output FIFO 1 11 = Write local Output FIFO 2 1 Select OutputValue [Out₁ or Out₂] 3 Select part of Output Value to write (32 bits = 4bytes ABCD) 000 = 0D 001 = 0D 010 = 0B 011 = 0A 100 = CD 101 = BC 110 =AB 111 = 0 6 TOTAL

[0555] Computational Blocks

[0556] Each ALU 188 has two computational process blocks, namely anAdder/Logic process block 204, and a Multiply/Interpolate process block205. In addition there is a Barrel Shifter block to provide help tothese computational blocks. Registers from the Registers block 215 canbe used for temporary storage during pipelined operations.

[0557] Barrel Shifter

[0558] The Barrel Shifter process block 206 is shown in more detail inFIG. 13 and takes its input from the output of Adder/Logic orMultiply/Interpolate process blocks or the previous cycle's results fromthose blocks (ALU registers L and M). The 32 bits selected are barrelshifted an arbitrary number of bits in either direction (with signextension as necessary), and output to the ALU 188's S register 209. Themicrocode for the Barrel Shift process block is described in thefollowing table. Note that the interpretations of some bit patterns aredeliberately chosen to aid decoding. # Bits Description 3 000 = NOP 001= Shift Left (unsigned) 010 = Reserved 011 = Shift Left (unsigned) 100 =Shift right (unsigned, no rounding) 101 = Shift right (unsigned, withrounding) 110 = Shift right (signed, no rounding) 111 = Shift right(signed, with rounding) 2 Select Input to barrel shift: 00 =Multiply/Interpolate result 01 = M 10 = Adder/Logic result 11 = L 5 #bits to shift 1 Ceiling of 255 1 Floor of 0 (signed data) 12 TOTAL

[0559] Adder Logic 204

[0560] The logic process block is shown in more detail in FIG. 14 and isdesigned for simple 32-bit addition/subtraction, comparisons, andlogical operations In a single cycle a single addition, comparison, orlogical operation can be performed, with the result stored in the ALU188's L register 209. There are two primary operands, A and B, which areselected from either of the two crossbars or from the 4 constantregisters. One crossbar selection allows the results of the previouscycle's arithmetic operation to be used while the second provides accessto operands previously calculated by this or another ALU 188. The CPU isthe only unit that has write access to the four constants (K₁-K₄). Incases where an operation such as (A+B)×4 is desired, the direct outputfrom the adder can be used as input to the Barrel Shifter, and can thusbe shifted left 2 places without needing to be latched into the Lregister 209 first. The output from the adder can also be made availableto the multiply unit for a multiply-operation. accumulate operation. Themicrocode for the Adder/Logic process block is described in thefollowing table. The interpretations of some bit patterns arediliberately chosen to aid decoding. Microcode bit interpretation forAdder/Logic unit # Bits Description 4 0000 = A + B (carry in = 0) 0001 =A + B (carry in = carry out of previous operation) 0010 = A + B + 1(carry in = 1) 0011 = A + 1 (increments A) 0100 = A − B − 1 (carry in =0) 0101 = A − B (carry in = carry out of previous operation) 0110 = A −B (carry in = 1) 0111 = A − 1 (decrements A) 1000 = NOP 1001 = ABS(A −B) 1010 = MIN(A, B) 1011 = MAX(A, B) 1100 = A AND B (both A & B can beinverted, see below) 1101 = A OR B (both A & B can be inverted, seebelow) 1110 = A XOR B (both A & B can be inverted, see below) 1111 = A(A can be inverted, see below) 1 If logical operation: 0 = A = A 1 = A =NOT(A) If Adder operation: 0 = A is unsigned 1 = A is signed 1 Iflogical operation: 0 = B = B 1 = B = NOT(B) If Adder operation: 0 = B isunsigned 1 = B is signed 4 Select A [In₁, In₂, Out₁, Out₂, D₀, D₁, D₂,D₃, M, L, S, R, K₁, K₂, K₃, K₄] 4 Select B [In₁, In₂, Out₁, Out₂, D₀,D₁, D₂, D₃, M, L, S, R, K₁, K₂, K₃, K₄] 14 TOTAL

[0561] Multiply/Interpolate 205

[0562] The Multiply/Interpolate process block is shown in more detail inFIG. 15 and is a set of four 8×8 interpolator units that are capable ofperforming four individual 8×8 interpolates per cycle, or can becombined to perform a single 16×16 multiply. This gives the possibilityto perform up to 4 linear interpolations, a single bi-linearinterpolation, or half of a tri-linear interpolation in a single cycle.The result of the interpolations or multiplication is stored in the ALU188's M register 209. There are two primary operands, A and B, which areselected from any of the general registers in the ALU 188 or from fourprogrammable constants internal to the Multiply/Interpolate processblock. Each interpolator block functions as a simple 8 bit interpolator[result=A+(B−A)f] or as a simple 8×8 multiply [result=A*B]. When theoperation is interpolation, A and B are treated as four 8 bit numbers A₀thru A₃ (A₀ is the low order byte), and B₀ thru B₃. Agen, Bgen, and Fgenare responsible for ordering the inputs to the Interpolate units so thatthey match the operation being performed. For example, to performbilinear interpolation, each of the 4 values must be multiplied by adifferent factor & the result summed, while a 16×16 bit multiplicationrequires the factors to be 0. The microcode for the Adder/Logic processblock is described in the following table. Note that the interpretationsof some bit patterns are deliberately chosen to aid decoding. # BitsDescription 4 0000 = (A₁₀ * B₁₀) + V 0001 = (A0 * B0) + (A1 * B1) + V0010 = (A₁₀ * B₁₀) − V 0011 = V − (A₁₀ * B₁₀) 0100 = Interpolate A₀, B₀by f₀ 0101 = Interpolate A₀, B₀ by f₀, A₁, B₁ by f₁ 0110 = InterpolateA₀, B₀ by f₀, A₁, B₁ by f₁, A₂, B₂ by f₂ 0111 = Interpolate A₀, B₀ byf₀, A₁, B₁ by f₁, A₂, B₂ by f₂, A₃, B₃ by f₃ 1000 = Interpolate 16 bitsstage 1 [M = A₁₀ * f₁₀] 1001 = Interpolate 16 bits stage 2 [M = M +(A₁₀ * f₁₀)] 1010 = Tri-linear interpolate A by f stage 1 [M = A₀f₀ +A₁f₁ + A₂f₂ + A₃f₃] 1011 = Tri-linear interpolate A by f stage 2 [M =M + A₀f₀ + A₁f₁ + A₂f₂ + A₃f₃] 1100 = Bi-linear interpolate A by f stage1 [M = A₀f₀ + A₁f₁] 1101 = Bi-linear interpolate A by f stage 2 [M = M +A₀f₀ + A₁f₁] 1110 = Bi-linear interpolate A by f complete [M = A₀f₀ +A₁f₁ + A₂f₂ + A₃f₃] 1111 = NOP 4 Select A [In₁, In₂, Out₁, Out₂, D₀, D₁,D₂, D₃, M, L, S, R, K₁, K₂, K₃, K₄] 4 Select B [In₁, In₂, Out₁, Out₂,D₀, D₁, D₂, D₃, M, L, S, R, K₁, K₂, K₃, K₄] If Mult: 4 Select V [In₁,In₂, 0ut₁, 0ut₂, D₀, D₁, D₂, D₃, K₁, K₂, K₃, K₄, Adder result, M, 0, 1]1 Treat A as signed 1 Treat B as signed 1 Treat V as signed If Interp: 4Select basis for f [In₁, In₂, Out₁, Out₂, D₀, D₁, D₂, D₃, K₁, K₂, K₃,K₄, X, X, X, X] 1 Select interpolation f generation from P₁ or P₂ P_(n)is interpreted as # fractional bits in f If P_(n) = 0, f is range 0 . .. 255 representing 0 . . . 1 2 Reserved 19 TOTAL

[0563] The same 4 bits are used for the selection of V and f, althoughthe last 4 options for V don't generally make sense as f values.Interpolating with a factor of 1 or 0 is pointless, and the previousmultiplication or current result is unlikely to be a meaningful valuefor f.

[0564] I/O Address GeneratorS 189, 190

[0565] The I/O Address Generators are shown in more detail in FIG. 16. AVLIW process does not access DRAM directly. Access is via 2 I/O AddressGenerators 189, 190, each with its own Input and Output FIFO. A PU e.g178 reads data from one of two local Input FIFOs, and writes data to oneof two local Output FIFOs. Each I/O Address Generator is responsible forreading data from DRAM and placing it into its Input FIFO, where it canbe read by the PU e.g 178, and is responsible for taking the data fromits Output FIFO (placed there by the PU e.g 178) and writing it to DRAM.The I/O Address Generator is a state machine responsible for generatingaddresses and control for data retrieval and storage in DRAM via theData cache 76. It is customizable under CPU software control, but cannotbe microcoded. The address generator produces addresses in two broadcategories:

[0566] Image Iterators, used to iterate (reading, writing or both)through pixels of an image in a variety of ways

[0567] Table I/O, used to randomly access pixels in images, data intables, and to simulate FIFOs in DRAM

[0568] Each of the I/O Address Generators 189, 190 has its own busconnection to the Data cache 76, making 2 bus connections per PU e.g178, and a total of 8 buses over the entire VLIW Vector Processor 74.The Data cache 76 is able to service 4 of the maximum 8 requests fromthe 4 PUs e.g 178 each cycle. The Input and Output FIFOs are 8 entrydeep 16-bit wide FIFOs. The various types of address generation (ImageIterators and Table I/O) are described in the subsequent sections.

[0569] Registers

[0570] The I/O Address Generator has a set of registers for that areused to control address generation. The addressing mode also determineshow the data is formatted and sent into the local Input FIFO, and howdata is interpreted from the local Output FIFO. The CPU is able toaccess the registers of the I/O Address Generator via the low speed bus.The first set of registers define the housekeeping parameters for theI/O Generator: Register # Name bits Description Reset 0 A write to thisregister halts any operations, and writes 0s to all the data registersof the I/O Generator. The input and output FIFOs are not cleared. Go 0 Awrite to this register restarts the counters according to the currentsetup. For example, if the I/O Generator is a Read Iterator, and theIterator is currently halfway through the image, a write to Go willcause the reading to begin at the start of the image again. While theI/O Generator is performing, the Active bit of the Status register willbe set. Halt 0 A write to this register stops any current activity andclears the Active bit of the Status register. If the Active bit isalready cleared, writing to this register has no effect. Continue 0 Awrite to this register continues the I/O Generator from the currentsetup. Counters are not reset, and FIFOs are not cleared. A write tothis register while the I/O Generator is active has no effect.ClearFIFOsOnGo 1 0 = Don't clear FIFOs on a write to the Go bit. 1 = Doclear FIFOs on a write to the Go bit. Status 8 Status flags

[0571] The Status register has the following values Register Name # bitsDescription Active 1 0 = Currently inactive 1 = Currently activeReserved 7 —

[0572] Caching

[0573] Several registers are used to control the caching mechanism,specifying which cache group to use for inputs, outputs etc. See thesection on the Data cache 76 for more information about cache groups.Register Name # bits Description CacheGroup1 4 Defines cache group toread data from CacheGroup2 4 Defines which cache group to write data to,and in the case of the ImagePyramidLookup I/O mode, defines the cache touse for reading the Level Information Table.

[0574] Image Iterators=Sequential Automatic Access to pixels

[0575] The primary image pixel access method for software and hardwarealgorithms is via Image Iterators. Image iterators perform all of theaddressing and access to the caches of the pixels within an imagechannel and read, write or read & write pixels for their client. ReadIterators read pixels in a specific order for their clients, and WriteIterators write pixels in a specific order for their clients. Clients ofIterators read pixels from the local Input FIFO or write pixels via thelocal Output FIFO.

[0576] Read Image Iterators read through an image in a specific order,placing the pixel data into the local Input FIFO. Every time a clientreads a pixel from the Input FIFO, the Read Iterator places the nextpixel from the image (via the Data cache 76) into the FIFO.

[0577] Write Image Iterators write pixels in a specific order to writeout the entire image. Clients write pixels to the Output FIFO that is inturn read by the Write Image Iterator and written to DRAM via the Datacache 76.

[0578] Typically a VLIW process will have its input tied to a ReadIterator, and output tied to a corresponding Write Iterator. From the PUe.g 178 microcode program's perspective, the FIFO is the effectiveinterface to DRAM. The actual method of carrying out the storage (apartfrom the logical ordering of the data) is not of concern. Although theFIFO is perceived to be effectively unlimited in length, in practice theFIFO is of limited length, and there can be delays storing andretrieving data, especially if several memory accesses are competing. Avariety of Image Iterators exist to cope with the most common addressingrequirements of image processing algorithms. In most cases there is acorresponding Write Iterator for each Read Iterator. The differentIterators are listed in the following table: Read Iterators WriteIterators Sequential Read Sequential Write Box Read — Vertical StripRead Vertical Strip Write

[0579] The 4 bit Address Mode Register is used to determine the Iteratortype: Bit # Address Mode 3 0 = This addressing mode is an Iterator 2 to0 Iterator Mode 001 = Sequential Iterator 010 = Box [read only] 100 =Vertical Strip remaining bit patterns are reserved

[0580] The Access Specific registers are used as follows: Register NameLocalName Description AccessSpecific₁ Flags Flags used for reading andwriting AccessSpecific₂ XBoxSize Determines the size in X of Box Read.Valid values are 3, 5, and 7. AccessSpecific₃ YBoxSize Determines thesize in Y of Box Read. Valid values are 3, 5, and 7. AccessSpecific₄BoxOffset Offset between one pixel center and the next during a Box Readonly. Usual value is 1, but other useful values include 2, 4, 8 . . .See Box Read for more details.

[0581] The Flags register (AccessSpecific₁) contains a number of flagsused to determine factors affecting the reading and writing of data. TheFlags register has the following composition: Label #bits DescriptionReadEnable 1 Read data from DRAM WriteEnable 1 Write data to DRAM [notvalid for Box mode] PassX 1 Pass X (pixel) ordinate back to Input FIFOPassY 1 Pass Y (row) ordinate back to Input FIFO Loop 1 0 = Do not loopthrough data 1 = Loop through data Reserved 11 Must be 0

[0582] Notes on ReadEnable and WriteEnable:

[0583] When ReadEnable is set, the I/O Address Generator acts as a ReadIterator, and therefore reads the image in a particular order, placingthe pixels into the Input FIFO.

[0584] When WriteEnable is set, the I/O Address Generator acts as aWrite Iterator, and therefore writes the image in a particular order,taking the pixels from the Output FIFO.

[0585] When both ReadEnable and WriteEnable are set, the I/O AddressGenerator acts as a Read Iterator and as a Write Iterator, readingpixels into the Input FIFO, and writing pixels from the Output FIFO.Pixels are only written after they have been read—i.e. the WriteIterator will never go faster than the Read Iterator. Whenever this modeis used, care should be taken to ensure balance between in and outprocessing by the VLIW microcode. Note that separate cache groups can bespecified on reads and writes by loading different values in CacheGroup1and CacheGroup2.

[0586] Notes on PassX and PassY:

[0587] If PassX and PassY are both set, the Y ordinate is placed intothe Input FIFO before the X ordinate.

[0588] PassX and PassY are only intended to be set when the ReadEnablebit is clear. Instead of passing the ordinates to the address generator,the ordinates are placed directly into the Input FIFO. The ordinatesadvance as they are removed from the FIFO.

[0589] If WriteEnable bit is set, the VLIW program must ensure that itbalances reads of ordinates from the Input FIFO with writes to theOutput FIFO, as writes will only occur up to the ordinates (see note onReadEnable and WriteEnable above).

[0590] Notes on Loop:

[0591] If the Loop bit is set, reads will recommence at [StartPixel,StartRow] once it has reached [EndPixel, EndRow]. This is ideal forprocessing a structure such a convolution kernel or a dither cellmatrix, where the data must be read repeatedly.

[0592] Looping with ReadEnable and WriteEnable set can be useful in anenvironment keeping a single line history, but only where it is usefulto have reading occur before writing. For a FIFO effect (where writingoccurs before reading in a length constrained fashion), use anappropriate Table I/O addressing mode instead of an Image Iterator.

[0593] Looping with only WriteEnable set creates a written window of thelast N pixels. This can be used with an asynchronous process that readsthe data from the window. The Artcard Reading algorithm makes use ofthis mode.

[0594] Sequential Read and Write Iterators

[0595]FIG. 17 illustrates the pixel data format. The simplest ImageIterators are the Sequential Read Iterator and corresponding SequentialWrite Iterator. The Sequential Read Iterator presents the pixels from achannel one line at a time from top to bottom, and within a line, pixelsare presented left to right. The padding bytes are not presented to theclient. It is most useful for algorithms that must perform some processon each pixel from an image but don't care about the order of the pixelsbeing processed, or want the data specifically in this order.Complementing the Sequential Read Iterator is the Sequential WriteIterator. Clients write pixels to the Output FIFO. A Sequential WriteIterator subsequently writes out a valid image using appropriate cachingand appropriate padding bytes. Each Sequential Iterator requires accessto 2 cache lines. When reading, while 32 pixels are presented from onecache line, the other cache line can be loaded from memory. Whenwriting, while 32 pixels are being filled up in one cache line, theother can be being written to memory.

[0596] A process that performs an operation on each pixel of an imageindependently would typically use a Sequential Read Iterator to obtainpixels, and a Sequential Write Iterator to write the new pixel values totheir corresponding locations within the destination image. Such aprocess is shown in FIG. 18.

[0597] In most cases, the source and destination images are different,and are represented by 2 I/O Address Generators 189, 190. However it canbe valid to have the source image and destination image to be the same,since a given input pixel is not read more than once. In that case, thenthe same Iterator can be used for both input and output, with both theReadEnable and WriteEnable registers set appropriately. For maximumefficiency, 2 different cache groups should be used—one for reading andthe other for writing. If data is being created by a VLIW process to bewritten via a Sequential Write Iterator, the PassX and PassY flags canbe used to generate coordinates that are then passed down the InputFIFO. The VLIW process can use these coordinates and create the outputdata appropriately.

[0598] Box Read Iterator

[0599] The Box Read Iterator is used to present pixels in an order mostuseful for performing operations such as general-purpose filters andconvolve. The Iterator presents pixel values in a square box around thesequentially read pixels. The box is limited to being 1, 3, 5, or 7pixels wide in X and Y (set XBoxSize and YBoxSize—they must be the samevalue or 1 in one dimension and 3, 5, or 7 in the other). The process isshown in FIG. 19:

[0600] BoxOffset: This special purpose register is used to determine asub-sampling in terms of which input pixels will be used as the centerof the box. The usual value is 1, which means that each pixel is used asthe center of the box. The value “2” would be useful in scaling an imagedown by 4:1 as in the case of building an image pyramid. Using pixeladdresses from the previous diagram, the box would be centered on pixel0, then 2, 8, and 10. The Box Read Iterator requires access to a maximumof 14 (2×7) cache lines. While pixels are presented from one set of 7lines, the other cache lines can be loaded from memory.

[0601] Box Write Iterator

[0602] There is no corresponding Box Write Iterator, since theduplication of pixels is only required on input. A process that uses theBox Read Iterator for input would most likely use the Sequential WriteIterator for output since they are in sync. A good example is theconvolver, where N input pixels are read to calculate 1 output pixel.The process flow is as illustrated in FIG. 20. The source anddestination images should not occupy the same memory when using a BoxRead Iterator, as subsequent lines of an image require the original (notnewly calculated) values.

[0603] Vertical-Strip Read and Write Iterators

[0604] In some instances it is necessary to write an image in outputpixel order, but there is no knowledge about the direction of coherencein input pixels in relation to output pixels. An example of this isrotation. If an image is rotated 90 degrees, and we process the outputpixels horizontally, there is a complete loss of cache coherence. On theother hand, if we process the output image one cache line's width ofpixels at a time and then advance to the next line (rather than advanceto the next cache-line's worth of pixels on the same line), we will gaincache coherence for our input image pixels. It can also be the case thatthere is known ‘block’ coherence in the input pixels (such as colorcoherence), in which case the read governs the processing order, and thewrite, to be synchronized, must follow the same pixel order.

[0605] The order of pixels presented as input (Vertical-Strip Read), orexpected for output (Vertical-Strip Write) is the same. The order ispixels 0 to 31 from line 0, then pixels 0 to 31 of line 1 etc for alllines of the image, then pixels 32 to 63 of line 0, pixels 32 to 63 ofline 1 etc. In the final vertical strip there may not be exactly 32pixels wide. In this case only the actual pixels in the image arepresented or expected as input. This process is illustrated in FIG. 21.

[0606] process that requires only a Vertical-Strip Write Iterator willtypically have a way of mapping input pixel coordinates given an outputpixel coordinate. It would access the input image pixels according tothis mapping, and coherence is determined by having sufficient cachelines on the ‘random-access’ reader for the input image. The coordinateswill typically be generated by setting the PassX and PassY flags on theVerticalStripWrite Iterator, as shown in the process overviewillustrated in FIG. 22.

[0607] It is not meaningful to pair a Write Iterator with a SequentialRead Iterator or a Box read Iterator, but a Vertical-Strip WriteIterator does give significant improvements in performance when there isa non trivial mapping between input and output coordinates.

[0608] It can be meaningful to pair a Vertical Strip Read Iterator andVertical Strip Write Iterator. In this case it is possible to assignboth to a single ALU 188 if input and output images are the same. Ifcoordinates are required, a further Iterator must be used with PassX andPassY flags set. The Vertical Strip Read/Write Iterator presents pixelsto the Input FIFO, and accepts output pixels from the Output FIFO.Appropriate padding bytes will be inserted on the write. Input andoutput require a minimum of 2 cache lines each for good performance.

[0609] Table I/O Addressing Modes

[0610] It is often necessary to lookup values in a table (such as animage). Table I/O addressing modes provide this functionality, requiringthe client to place the index/es into the Output FIFO. The I/O AddressGenerator then processes the index/es, looks up the data appropriately,and returns the looked-up values in the Input FIFO for subsequentprocessing by the VLIW client.

[0611] 1D, 2D and 3D tables are supported, with particular modestargeted at interpolation. To reduce complexity on the VLIW client side,the index values are treated as fixed-point numbers, with AccessSpecificregisters defining the fixed point and therefore which bits should betreated as the integer portion of the index. Data formats are restrictedforms of the general Image Characteristics in that the PixelOffsetregister is ignored, the data is assumed to be contiguous within a row,and can only be 8 or 16 bits (1 or 2 bytes) per data element. The 4 bitAddress Mode Register is used to determine the I/O type: Bit # AddressMode 3  1 = This addressing mode is Table I/O 2 to 0 000 = 1D DirectLookup 001 = 1D Interpolate (linear) 010 = DRAM FIFO 011 = Reserved 100= 2D Interpolate (bi-linear) 101 = Reserved 110 = 3D Interpolate(tri-linear) 111 = Image Pyramid Lookup

[0612] The access specific registers are: Register Name LocalName #bitsDescription AccessSpecific₁ Flags 8 General flags for reading andwriting. See below for more information. AccessSpecific₂ FractX 8 Numberof fractional bits in X index AccessSpecific₃ FractY 8 Number offractional bits in Y index AccessSpecific₄ FractZ 8 Number of fractionalbits (low 8 bits / next in Z index 12 or 24 bits)) ZOffset 12 or Seebelow 24

[0613] FractX, FractY, and FractZ are used to generate addresses basedon indexes, and interpret the format of the index in terms ofsignificant bits and integer/fractional components. The variousparameters are only defined as required by the number of dimensions inthe table being indexed. A 1D table only needs FractX, a 2D tablerequires FractX and FractY. Each Fract_ value consists of the number offractional bits in the corresponding index. For example, an X index maybe in the format 5:3. This would indicate 5 bits of integer, and 3 bitsof fraction. FractX would therefore be set to 3. A simple 1D lookupcould have the format 8:0, i.e. no fractional component at all. FractXwould therefore be 0. ZOffset is only required for 3D lookup and takeson two different interpretations. It is described more fully in the3D-table lookup section. The Flags register (AccessSpecific₁) contains anumber of flags used to determine factors affecting the reading (and inone case, writing) of data. The Flags register has the followingcomposition: Label #bits Description ReadEnable 1 Read data from DRAMWriteEnable 1 Write data to DRAM [only valid for 1D direct lookup]DataSize 1 0 = 8 bit data 1 = 16 bit data Reserved 5 Must be 0

[0614] With the exception of the 1D Direct Lookup and DRAM FIFO, allTable I/O modes only support reading, and not writing. Therefore theReadEnable bit will be set and the WriteEnable bit will be clear for allI/O modes other than these two modes. The 1D Direct Lookup supports 3modes:

[0615] Read only, where the ReadEnable bit is set and the WriteEnablebit is clear

[0616] Write only, where the ReadEnable bit is clear and the WriteEnablebit is clear

[0617] Read-Modify-Write, where both ReadEnable and the WriteEnable bitsare set

[0618] The different modes are described in the 1D Direct Lookup sectionbelow. The DRAM FIFO mode supports only 1 mode:

[0619] Write-Read mode, where both ReadEnable and the WriteEnable bitsare set

[0620] This mode is described in the DRAM FIFO section below. TheDataSize flag determines whether the size of each data elements of thetable is 8 or 16 bits. Only the two data sizes are supported. 32 bitelements can be created in either of 2 ways depending on therequirements of the process:

[0621] Reading from 2 16-bit tables simultaneously and combining theresult. This is convenient if timing is an issue, but has thedisadvantage of consuming 2 I/O Address Generators 189, 190, and each32-bit element is not readable by the CPU as a 32-bit entity.

[0622] Reading from a 16-bit table twice and combining the result. Thisis convenient since only 1 lookup is used, although different indexesmust be generated and passed into the lookup.

[0623] 1 Dimensional Structures

[0624] Direct Lookup

[0625] A direct lookup is a simple indexing into a 1 dimensional lookuptable. Clients can choose between 3 access modes by setting appropriatebits in the Flags register:

[0626] Read only

[0627] Write only

[0628] Read-Modify-Write

[0629] Read Only

[0630] A client passes the fixed-point index X into the Output FIFO, andthe 8 or 16-bit value at Table[Int(X)] is returned in the Input FIFO.The fractional component of the index is completely ignored. If theindex is out of bounds, the DuplicateEdge flag determines whether theedge pixel or ConstantPixel is returned. The address generation isstraightforward:

[0631] If DataSize indicates 8 bits, X is barrel-shifted right FractXbits, and the result is added to the table's base address ImageStart.

[0632] If DataSize indicates 16 bits, X is barrel-shifted right FractXbits, and the result shifted left 1 bit (bit0 becomes 0) is added to thetable's base address ImageStart.

[0633] The 8 or 16-bit data value at the resultant address is placedinto the Input FIFO. Address generation takes 1 cycle, and transferringthe requested data from the cache to the Output FIFO also takes 1 cycle(assuming a cache hit). For example, assume we are looking up values ina 256-entry table, where each entry is 16 bits, and the index is a 12bit fixed-point format of 8:4. FractX should be 4, and DataSize 1. Whenan index is passed to the lookup, we shift right 4 bits, then add theresult shifted left 1 bit to ImageStart.

[0634] Write Only

[0635] A client passes the fixed-point index X into the Output FIFOfollowed by the 8 or 16-bit value that is to be written to the specifiedlocation in the table. A complete transfer takes a minimum of 2 cycles.1 cycle for address generation, and 1 cycle to transfer the data fromthe FIFO to DRAM. There can be an arbitrary number of cycles between aVLIW process placing the index into the FIFO and placing the value to bewritten into the FIFO. Address generation occurs in the same way as ReadOnly mode, but instead of the data being read from the address, the datafrom the Output FIFO is written to the address. If the address isoutside the table range, the data is removed from the FIFO but notwritten to DRAM.

[0636] Read-Modify-Write

[0637] A client passes the fixed-point index X into the Output FIFO, andthe 8 or 16-bit value at Table[Int(X)] is returned in the Input FIFO.The next value placed into the Output FIFO is then written toTable[Int(X)], replacing the value that had been returned earlier. Thegeneral processing loop then, is that a process reads from a location,modifies the value, and writes it back. The overall time is 4 cycles:

[0638] Generate address from index

[0639] Return value from table

[0640] Modify value in some way

[0641] Write it back to the table

[0642] There is no specific read/write mode where a client passes in aflag saying “read from X”or “write to X”. Clients can simulate a “readfrom X” by writing the original value, and a “write to X” by simplyignoring the returned value. However such use of the mode is notencouraged since each action consumes a minimum of 3 cycles (the modifyis not required) and 2 data accesses instead of 1 access as provided bythe specific Read and Write modes.

[0643] Interpolate Table

[0644] This is the same as a Direct Lookup in Read mode except that twovalues are returned for a given fixed-point index X instead of one. Thevalues returned are Table[Int(X)], and Table[Int(X)+1]. If either indexis out of bounds the DuplicateEdge flag determines whether the edgepixel or ConstantPixel is returned. Address generation is the same asDirect Lookup, with the exception that the second address is simplyAddress1+1 or 2 depending on 8 or 16 bit data. Transferring therequested data to the Output FIFO takes 2 cycles (assuming a cache hit),although two 8-bit values may actually be returned from the cache to theAddress Generator in a single 16-bit fetch.

[0645] DRAM FIFO

[0646] A special case of a read/write 1D table is a DRAM FIFO. It isoften necessary to have a simulated FIFO of a given length using DRAMand associated caches. With a DRAM FIFO, clients do not index explicitlyinto the table, but write to the Output FIFO as if it was one end of aFIFO and read from the Input FIFO as if it was the other end of the samelogical FIFO. 2 counters keep track of input and output positions in thesimulated FIFO, and cache to DRAM as needed. Clients need to set bothReadEnable and WriteEnable bits in the Flags register.

[0647] An example use of a DRAM FIFO is keeping a single line history ofsome value. The initial history is written before processing begins. Asthe general process goes through a line, the previous line's valueis.retrieved from the FIFO, and this line's value is placed into theFIFO (this line will be the previous line when we process the nextline). So long as input and outputs match each other on average, theOutput FIFO should always be full. Consequently there is effectively noaccess delay for this kind of FIFO (unless the total FIFO length is verysmall—say 3 or 4 bytes, but that would defeat the purpose of the FIFO).

[0648] 2 Dimensional Tables

[0649] Direct Lookup

[0650] A 2 dimensional direct lookup is not supported. Since all casesof 2D lookups are expected to be accessed for bi-linear interpolation,.a special bi-linear lookup has been implemented.

[0651] Bi-Linear lookup

[0652] This kind of lookup is necessary for bi-linear interpolation ofdata from a 2D table. Given fixed-point X and Y coordinates (placed intothe Output FIFO in the order Y, X), 4 values are returned after lookup.The values (in order) are:

[0653] Table[Int(X), Int(Y)]

[0654] Table[Int(X)+1, Int(Y)]

[0655] Table[Int(X), Int(Y)+1]

[0656] Table[Int(X)+1, Int(Y)+1]

[0657] The order of values returned gives the best cache coherence. Ifthe data is 8-bit, 2 values are returned each cycle over 2 cycles withthe low order byte being the first data element. If the data is 16-bit,the 4 values are returned in 4 cycles, 1 entry per cycle. Addressgeneration takes 2 cycles. The first cycle has the index (Y)barrel-shifted right FractY bits being multiplied by RowOffset, with theresult added to ImageStart. The second cycle shifts the X index right byFractX bits, and then either the result (in the case of 8 bit data) orthe result shifted left 1 bit (in the case of 16 bit data) is added tothe result from the first cycle. This gives us address Adr=address ofTable[Int(X), Int(Y)]:

Adr=ImageStart +ShiftRight(Y, FractY)*RowOffset) +ShiftRight(X, FractX)

[0658] We keep a copy of Adr in AdrOld for use fetching subsequententries.

[0659] If the data is 8 bits, the timing is 2 cycles of addressgeneration, followed by 2 cycles of data being returned (2 table entriesper cycle).

[0660] If the data is 16 bits, the timing is 2 cycles of addressgeneration, followed by 4 cycles of data being returned (1 entry percycle)

[0661] The following 2 tables show the method of address calculation for8 and 16 bit data sizes: Cycle Calculation while fetching 2 × 8-bit dataentries from Adr 1 Adr = Adr + RowOffset 2 <preparing next lookup> CycleCalculation while fetching 1 × 16-bit data entry from Adr 1 Adr = Adr +2 2 Adr = AdrOld + RowOffset 3 Adr = Adr + 2 4 <preparing next lookup>

[0662] In both cases, the first cycle of address generation can overlapthe insertion of the X index into the FIFO, so the effective timing canbe as low as 1 cycle for address generation, and 4 cycles of returndata. If the generation of indexes is 2 steps ahead of the results, thenthere is no effective address generation time, and the data is simplyproduced at the appropriate rate (2 or 4 cycles per set).

[0663] 3 Dimensional Lookup

[0664] Direct Lookup

[0665] Since all cases of 2D lookups are expected to be accessed fortri-linear interpolation, .two special tri-linear lookups have beenimplemented. The first is a straightforward lookup table, while thesecond is for tri-linear interpolation from an Image Pyramid.

[0666] Tri-Linear Lookup

[0667] This type of lookup is useful for 3D tables of data, such ascolor conversion tables. The standard image parameters define a singleXY plane of the data—i.e. each plane consists of ImageHeight rows, eachrow containing RowOffset bytes. In most circumstances, assumingcontiguous planes, one XY plane will be ImageHeight×RowOffset bytesafter another. Rather than assume or calculate this offset, the softwarevia the CPU must provide it in the form of a 12-bit ZOffset register. Inthis form of lookup, given 3 fixed-point indexes in the order Z, Y, X, 8values are returned in order from the lookup table:

[0668] Table[Int(X), Int(Y), Int(Z)]

[0669] Table[Int(X)+1, Int(Y), Int(Z)]

[0670] Table[Int(X), Int(Y)+1, Int(Z)]

[0671] Table[Int(X)+1, Int(Y)+1, Int(Z)]

[0672] Table[Int(X), Int(Y), Int(Z)+1]

[0673] Table[Int(X)+1, Int(Y), Int(Z)+1]

[0674] Table[Int(X), Int(Y)+1, Int(Z)+1]

[0675] Table[Int(X)+l, Int(Y)+1, Int(Z)+1]

[0676] The order of values returned gives the best cache coherence. Ifthe data is 8-bit, 2 values are returned each cycle over 4 cycles withthe low order byte being the first data element. If the data is 16-bit,the 4 values are returned in 8 cycles, 1 entry per cycle. Addressgeneration takes 3 cycles. The first cycle has the index (Z)barrel-shifted right FractZ bits being multiplied by the 12-bit ZOffsetand added to ImageStart. The second cycle has the index (Y)barrel-shifted right FractY bits being multiplied by RowOffset, with theresult added to the result of the previous cycle. The second cycleshifts the X index right by FractX bits, and then either the result (inthe case of 8 bit data) or the result shifted left 1 bit (in the case of16 bit data) is added to the result from the second cycle. This gives usaddress Adr=address of Table[Int(X), Int(Y), Int(Z)]:

[0677] Adr=ImageStart

[0678] +(ShiftRight(Z, FractZ)*ZOffset)

[0679] +(ShiftRight(Y, FractY)*RowOffset)

[0680] +ShiftRight(X, FractX)

[0681] We keep a copy of Adr in AdrOld for use fetching subsequententries.

[0682] If the data is 8 bits, the timing is 2 cycles of addressgeneration, followed by 2 cycles of data being returned (2 table entriesper cycle).

[0683] If the data is 16 bits, the timing is 2 cycles of addressgeneration, followed by 4 cycles of data being returned (1 entry percycle)

[0684] The following 2 tables show the method of address calculation for8 and 16 bit data sizes: Cycle Calculation while fetching 2 × 8-bit dataentries from Adr 1 Adr = Adr + RowOffset 2 Adr = AdrOld + ZOffset 3 Adr= Adr + RowOffset 4 <preparing next lookup> Cycle Calculation whilefetching 1 × 16-bit data entries from Adr 1 Adr = Adr + 2 2 Adr =AdrOld + RowOffset 3 Adr = Adr + 2 4 Adr, AdrOld = AdrOld + ZOffset 5Adr = Adr + 2 6 Adr = AdrOld + RowOffset 7 Adr = Adr + 2 8 <preparingnext lookup>

[0685] In both cases, the cycles of address generation can overlap theinsertion of the indexes into the FIFO, so the effective timing for asingle one-off lookup can be as low as 1 cycle for address generation,and 4 cycles of return data. If the generation of indexes is 2 stepsahead of the results, then there is no effective address generationtime, and the data is simply produced at the appropriate rate (4 or 8cycles per set).

[0686] Image Pyramid Lookup

[0687] During brushing, tiling, and warping it is necessary to computethe average color of a particular area in an image. Rather thancalculate the value for each area given, these functions make use of animage pyramid. The description and construction of an image pyramid isdetailed in the section on Internal Image Formats in the DRAM interface81 chapter of this document. This section is concerned with a method ofaddressing given pixels in the pyramid in terms of 3 fixed-point indexesordered: level (Z), Y, and X. Note that Image Pyramid lookup assumes 8bit data entries, so the DataSize flag is completely ignored. Afterspecification of Z, Y, and X, the following 8 pixels are returned viathe Input FIFO:

[0688] The pixel at [Int(X), Int(Y)], level Int(Z)

[0689] The pixel at [Int(X)+1, Int(Y)], level Int(Z)

[0690] The pixel at [Int(X), Int(Y)+1], level Int(Z)

[0691] The pixel at [Int(X)+1, Int(Y)+1], level Int(Z)

[0692] The pixel at [Int(X), Int(Y)], level Int(Z)+1

[0693] The pixel at [Int(X)+1, Int(Y)], level Int(Z)+1

[0694] The pixel at [Int(X), Int(Y)+1], level Int(Z)+1

[0695] The pixel at [Int(X)+1, Int(Y)+1], level Int(Z)+1

[0696] The 8 pixels are returned as 4×16 bit entries, with X and X+1entries combined hi/lo. For example, if the scaled (X, Y) coordinate was(10.4, 12.7) the first 4 pixels returned would be: (10, 12), (11, 12),(10, 13) and (11, 13). When a coordinate is outside the valid range,clients have the choice of edge pixel duplication or returning of aconstant color value via the DuplicateEdgePixels and ConstantPixelregisters (only the low 8 bits are used). When the Image Pyramid hasbeen constructed, there is a simple mapping from level 0 coordinates tolevel Z coordinates. The method is simply to shift the X or Y coordinateright by Z bits. This must be done in addition to the number of bitsalready shifted to retrieve the integer portion of the coordinate (i.e.shifting right FractX and FractY bits for X and Y ordinatesrespectively). To find the ImageStart and RowOffset value for a givenlevel of the image pyramid, the 24-bit ZOffset register is used as apointer to a Level Information Table. The table is an array of records,each representing a given level of the pyramid, ordered by level number.Each record consists of a 16-bit offset ZOffset from ImageStart to thatlevel of the pyramid (64-byte aligned address as lower 6 bits of theoffset are not present), and a 12 bit ZRowOffset for that level. Element0 of the table would contain a ZOffset of 0, and a ZRowOffset equal tothe general register RowOffset, as it simply points to the full sizedimage. The ZOffset value at element N of the table should be added toImageStart to yield the effective ImageStart of level N of the imagepyramid. The RowOffset value in element N of the table contains theRowOffset value for level N. The software running on the CPU must set upthe table appropriately before using this addressing mode. The actualaddress generation is outlined here in a cycle by cycle description:Load From Cycle Register Address Other Operations 0 — — ZAdr =ShiftRight(Z, FractZ) + ZOffset ZInt = ShiftRight(Z, FractZ) 1 ZOffsetZadr ZAdr += 2 YInt = ShiftRight(Y, FractY) 2 ZRowOffset ZAdr ZAdr += 2YInt = ShiftRight(YInt, ZInt) Adr = ZOffset + ImageStart 3 ZOffset ZAdrZAdr += 2 Adr += ZrowOffset * YInt XInt = ShiftRight(X, FractX) 4 ZAdrZAdr Adr += ShiftRight(XInt, ZInt) ZOffset += ShiftRight(XInt, 1) 5 FIFOAdr Adr += ZrowOffset ZOffset += ImageStart 6 FIFO Adr Adr = (ZAdr *ShiftRight(Yint, 1)) + ZOffset 7 FIFO Adr Adr += Zadr 8 FIFO Adr < Cycle0 for next retrieval>

[0697] The address generation as described can be achieved using asingle Barrel Shifter, 2 adders, and a single 16×16 multiply/add unityielding 24 bits. Although some cycles have 2 shifts, they are eitherthe same shift value (i.e. the output of the Barrel Shifter is used twotimes) or the shift is 1 bit, and can be hard wired. The followinginternal registers are required: ZAdr, Adr, ZInt, YInt, XInt,ZRowOffset, and ZImageStart. The ₁₃Int registers only need to be 8 bitsmaximum, while the others can be up to 24 bits. Since this access methodonly reads from, and does not write to image pyramids, the CacheGroup2is used to lookup the Image Pyramid Address Table (via ZAdr).CacheGroup1 is used for lookups to the image pyramid itself (via Adr.The address table is around 22 entries (depending on original imagesize), each of 4 bytes. Therefore 3 or 4 cache lines should be allocatedto CacheGroup2, while as many cache lines as possible should beallocated to CacheGroup1. The timing is 8 cycles for returning a set ofdata, assuming that Cycle 8 and Cycle 0 overlap in operation—i.e. thenext request's Cycle 0 occurs during Cycle 8. This is acceptable sinceCycle 0 has no memory access, and Cycle 8 has no specific operations.

[0698] Generation of Coordinates Using VLIW Vector Processor 74

[0699] Some functions that are linked to Write Iterators require the Xand/or Y coordinates of the current pixel being processed in part of theprocessing pipeline. Particular processing may also need to take placeat the end of each row, or column being processed. In most cases, thePassX and PassY flags should be sufficient to completely generate allcoordinates. However, if there are special requirements, the followingfunctions can be used. The calculation can be spread over a number ofALUs, for a single cycle generation, or be in a single ALU 188 for amulti-cycle generation.

[0700] Generate Sequential [X, Y]

[0701] When a process is processing pixels in sequential order accordingto the Sequential Read Iterator (or generating pixels and writing themout to a Sequential Write Iterator), the following process can be usedto generate X, Y coordinates instead of PassX/PassY flags as shown inFIG. 23.

[0702] The coordinate generator counts up to ImageWidth in the Xordinate, and once per ImageWidth pixels increments the Y ordinate. Theactual process is illustrated in FIG. 24, where the following constantsare set by software: Constant Value K₁ ImageWidth K₂ ImageHeight(optional)

[0703] The following registers are used to hold temporary variables:Variable Value Reg₁ X (starts at 0 each line) Reg₂ Y (starts at 0)

[0704] The requirements are summarized as follows: Requirements *+ + R KLU Iterators General 0 3/4 2 1/2 0 0 TOTAL 0 3/4 2 1/2 0 0

[0705] Generate Vertical Strip [X, Y]

[0706] When a process is processing pixels in order to write them to aVertical Strip Write Iterator, and for some reason cannot use thePassX/PassY flags, the process as illustrated in FIG. 25 can be used togenerate X, Y coordinates. The coordinate generator simply counts up toImageWidth in the X ordinate, and once per ImageWidth pixels incrementsthe Y ordinate. The actual process is illustrated in FIG. 26, where thefollowing constants are set by software: Constant Value K₁ 32 K₂ImageWidth K₃ ImageHeight

[0707] The following registers are used to hold temporary variables:Variable Value Reg₁ StartX (starts at 0, and is incremented by 32 onceper vertical strip) Reg₂ X Reg₃ EndX (starts at 32 and is incremented by32 to a maximum of ImageWidth) once per vertical strip) Reg₄ Y

[0708] The requirements are summarized as follows: Requirements *+ + R KLU Iterators General 0 4 4 3 0 0 TOTAL 0 4 4 3 0 0

[0709] The calculations that occur once per vertical strip (2 additions,one of which has an associated MIN) are not included in the generaltiming statistics because they are not really part of the per pixeltiming. However they do need to be taken into account for theprogramming of the microcode for the particular function.

[0710] Image Sensor Interface (ISI 83)

[0711] The Image Sensor Interface (ISI 83) takes data from the CMOSImage Sensor and makes it available for storage in DRAM. The imagesensor has an aspect ratio of 3:2, with a typical resolution of 750×500samples, yielding 375K (8 bits per pixel). Each 2×2 pixel block has theconfiguration as shown in FIG. 27. The ISI 83 is a state machine thatsends control information to the Image Sensor, including frame syncpulses and pixel clock pulses in order to read the image. Pixels areread from the image sensor and placed into the VLIW Input FIFO 78. TheVLIW is then able to process and/or store the pixels. This isillustrated further in FIG. 28. The ISI 83 is used in conjunction with aVLIW program that stores the sensed Photo Image in DRAM. Processingoccurs in 2 steps:

[0712] A small VLIW program reads the pixels from the FIFO and writesthem to DRAM via a Sequential Write Iterator.

[0713] The Photo Image in DRAM is rotated 90, 180 or 270 degreesaccording to the orientation of the camera when the photo was taken.

[0714] If the rotation is 0 degrees, then step 1 merely writes the PhotoImage out to the final Photo Image location and step 2 is not performed.If the rotation is other than 0 degrees, the image is written out to atemporary area (for example into the Print Image memory area), and thenrotated during step 2 into the final Photo Image location. Step 1 isvery simple microcode, taking data from the VLIW Input FIFO 78 andwriting it to a Sequential Write Iterator. Step 2's rotation isaccomplished by using the accelerated Vark Affine Transform function.The processing is performed in 2 steps in order to reduce designcomplexity and to re-use the Vark affine transform rotate logic alreadyrequired for images. This is acceptable since both steps are completedin approximately 0.03 seconds, a time imperceptible to the operator ofthe Artcam. Even so, the read process is sensor speed bound, taking 0.02seconds to read the full frame, and approximately 0.01 seconds to rotatethe image.

[0715] The orientation is important for converting between the sensedPhoto Image and the internal format image, since the relativepositioning of R, G, and B pixels changes with orientation. Theprocessed image may also have to be rotated during the Print process inorder to be in the correct orientation for printing. The 3D model of theArtcam has 2 image sensors, with their inputs multiplexed to a singleISI 83 (different microcode, but same ACP 31). Since each sensor is aframe store, both images can be taken simultaneously, and thentransferred to memory one at a time.

[0716] Display Controller 88

[0717] When the “Take” button on an Artcam is half depressed, the TFTwill display the current image from the image sensor (converted via asimple VLIW process). Once the Take button is fully depressed, the TakenImage is displayed. When the user presses the Print button and imageprocessing begins, the TFT is turned off. Once the image has beenprinted the TFT is turned on again. The Display Controller 88 is used inthose Artcam models that incorporate a flat panel display. An exampledisplay is a TFT LCD of resolution 240×160 pixels. The structure of theDisplay Controller 88 isl illustrated in FIG. 29. The Display Controller88 State Machine contains registers that control the timing of the SyncGeneration, where the display image is to be taken from (in DRAM via theData cache 76 via a specific Cache Group), and whether the TFT should beactive or not (via TFT Enable) at the moment. The CPU can write to theseregisters via the low speed bus. Displaying a 240×160 pixel image on anRGB TFT requires 3 components per pixel. The image taken from DRAM isdisplayed via 3 DACs, one for each of the R, G, and B output signals. Atan image refresh rate of 30 frames per second (60 fields per second) theDisplay Controller 88 requires data transfer rates of:

240×160×3×30=3.5 MB per second

[0718] This data rate is low compared to the rest of the system. Howeverit is high enough to cause VLIW programs to slow down during theintensive image processing. The general principles of TFT operationshould reflect this.

[0719] Image Data Formats

[0720] As stated previously, the DRAM Interface 81 is responsible forinterfacing between other client portions of the ACP chip and the RAMBUSDRAM. In effect, each module within the DRAM Interface is an addressgenerator.

[0721] There are three logical types of images manipulated by the ACP.They are:

[0722] CCD Image, which is the Input Image captured from the CCD.

[0723] Internal Image format—the Image format utilised internally by theArtcam device.

[0724] Print Image—the Output Image Format Printed by the Artcam

[0725] These images are typically different in color space, resolution,and the output & input color spaces which can vary from camera tocamera. For example, a CCD image on a low-end camera may be a differentresolution, or have different color characteristics from that used in ahigh-end camera. However all internal image formats are the same formatin terms of color space across all cameras.

[0726] In addition, the three image types can vary with respect to whichdirection is ‘up’. The physical orientation of the camera causes thenotion of a portrait or landscape image, and this must be maintainedthroughout processing. For this reason, the internal image is alwaysoriented correctly, and rotation is performed on images obtained fromthe CCD and during the print operation.

[0727] CCD Image Organization

[0728] Although many different CCD image sensors could be utilised, itwill be assumed that the CCD itself is a 750×500 image sensor, yielding375,000 bytes (8 bits per pixel). Each 2×2 pixel block having theconfiguration as depicted in FIG. 30.

[0729] A CCD Image as stored in DRAM has consecutive pixels with a givenline contiguous in memory. Each line is stored one after the other. Theimage sensor Interface 83 is responsible for taking data from the CCDand storing it in the DRAM correctly oriented. Thus a CCD image withrotation 0 degrees has its first line G, R, G, R, G, R . . . and itssecond line as B, G, B, G, B, G . . . . If the CCD image should beportrait, rotated 90 degrees, the first line will be R, G, R, G, R, Gand the second line G, B, G, B, G, B . . . etc.

[0730] Pixels are stored in an interleaved fashion since all colorcomponents are required in order to convert to the internal imageformat.

[0731] It should be noted that the ACP 31 makes no assumptions about theCCD pixel format, since the actual CCDs for imaging may vary from Artcamto Artcam, and over time. All processing that takes place via thehardware is controlled by major microcode in an attempt to extend theusefulness of the ACP 31.

[0732] Internal Image Organization

[0733] Internal images typically consist of a number of channels. Varkimages can include, but are not limited to:

[0734] Lab

[0735] Labα

[0736] LabΔ

[0737] αΔ

[0738] L

[0739] L, a and b correspond to components of the Lab color space, α isa matte channel (used for compositing), and Δ is a bump-map channel(used during brushing, tiling and illuminating).

[0740] The VLIW processor 74 requires images to be organized in a planarconfiguration. Thus a Lab image would be stored as 3 separate blocks ofmemory:

[0741] one block for the L channel,

[0742] one block for the a channel, and

[0743] one block for the b channel

[0744] Within each channel block, pixels are stored contiguously for agiven row (plus some optional padding bytes), and rows are stored oneafter the other.

[0745] Turning to FIG. 31 there is illustrated an example form ofstorage of a logical image 100. The logical image 100 is stored in aplanar fashion having L 101, a 102 and b 103 color components stored oneafter another. Alternatively, the logical image 100 can be stored in acompressed format having an uncompressed L component 101 and compressedA and B components 105, 106.

[0746] Turning to FIG. 32, the pixels of for line n 110 are storedtogether before the pixels of for line and n+1 (111). With the imagebeing stored in contiguous memory within a single channel.

[0747] In the 8 MB-memory model, the final Print Image after allprocessing is finished, needs to be compressed in the chrominancechannels. Compression of chrominance channels can be 4:1, causing anoverall compression of 12:6, or 2:1.

[0748] Other than the final Print Image, images in the Artcam aretypically not compressed. Because of memory constraints, software maychoose to compress the final Print Image in the chrominance channels byscaling each of these channels by 2:1. If this has been done, the PRINTVark function call utilised to print an image must be told to treat thespecified chrominance channels as compressed. The PRINT function is theonly function that knows how to deal with compressed chrominance, andeven so, it only deals with a fixed 2:1 compression ratio.

[0749] Although it is possible to compress an image and then operate onthe compressed image to create the final print image, it is notrecommended due to a loss in resolution. In addition, an image shouldonly be compressed once—as the final stage before printout. While onecompression is virtually undetectable, multiple compressions may causesubstantial image degradation.

[0750] Clip Image Organization

[0751] Clip images stored on Artcards have no explicit support by theACP 31. Software is responsible for taking any images from the currentArtcard and organizing the data into a form known by the ACP. If imagesare stored compressed on an Artcard, software is responsible fordecompressing them, as there is no specific hardware support fordecompression of Artcard images.

[0752] Image Pyramid Organization

[0753] During brushing, tiling, and warping processes utilised tomanipulate an image it is often necessary to compute the average colorof a particular area in an image. Rather than calculate the value foreach area given, these functions make use of an image pyramid. Asillustrated in FIG. 33, an image pyramid is effectively amulti-resolutionpixel-map. The original image 115 is a 1:1representation. Low-pass filtering and sub-sampling by 2:1 in eachdimension produces an image ¼ the original size 116. This processcontinues until the entire image is represented by a single pixel. Animage pyramid is constructed from an original internal format image, andconsumes ⅓ of the size taken up by the original image (¼+{fraction(1/16)}+{fraction (1/64)}+ . . . ). For an original image of 1500×1000the corresponding image pyramid is approximately ½ MB. An image pyramidis constructed by a specific Vark function, and is used as a parameterto other Vark functions.

[0754] Print Image Organization

[0755] The entire processed image is required at the same time in orderto print it. However the Print Image output can comprise a CMY ditheredimage and is only a transient image format, used within the Print Imagefunctionality. However, it should be noted that color conversion willneed to take place from the internal color space to the print colorspace. In addition, color conversion can be tuned to be different fordifferent print rolls in the camera with different ink characteristicse.g. Sepia output can be accomplished by using a specific sepia toningArtcard, or by using a sepia tone print-roll (so all Artcards will workin sepia tone).

[0756] Color Spaces

[0757] As noted previously there are 3 color spaces used in the Artcam,corresponding to the different image types.

[0758] The ACP has no direct knowledge of specific color spaces.Instead, it relies on client color space conversion tables to convertbetween CCD, internal, and printer color spaces:

[0759] CCD:RGB

[0760] Internal:Lab

[0761] Printer:CMY

[0762] Removing the color space conversion from the ACP 31 allows:

[0763] Different CCDs to be used in different cameras

[0764] Different inks (in different print rolls over time) to be used inthe same camera

[0765] Separation of CCD selection from ACP design path

[0766] A well defined internal color space for accurate color processing

[0767] Artcard Interface 87

[0768] The Artcard Interface (AI) takes data from the linear imageSensor while an Artcard is passing under it, and makes that dataavailable for storage in DRAM. The image sensor produces 11,000 8-bitsamples per scanline, sampling the Artcard at 4800 dpi. The AI is astate machine that sends control information to the linear sensor,including LineSync pulses and PixelClock pulses in order to read theimage. Pixels are read from the linear sensor and placed into the VLIWInput FIFO 78. The VLIW is then able to process and/or store the pixels.The AI has only a few registers: Register Name Description NumPixels Thenumber of pixels in a sensor line (approx 11,000) Status The Print HeadInterface's Status Register PixelsRemaining The number of bytesremaining in the current line Actions Reset A write to this registerresets the AI, stops any scanning, and loads all registers with 0. ScanA write to this register with a non-zero value sets the Scanning bit ofthe Status register, and causes the Artcard Interface Scan cycle tostart. A write to this register with 0 stops the scanning process andclears the Scanning bit in the Status register. The Scan cycle causesthe AI to transfer NumPixels bytes from the sensor to the VLIW InputFIFO 78, producing the PixelClock signals appropriately. Upon completionof NumPixels bytes, a LineSync pulse is given and the Scan cyclerestarts. The PixelsRemaining register holds the number of pixelsremaining to be read on the current scanline.

[0769] Artcard Interface (AI) 87

[0770] The Artcard Interface (AI) 87 is responsible for taking anArtcard image from the Artcard Reader 34 , and decoding it into theoriginal data (usually a Vark script). Specifically, the AI 87 acceptssignals from the Artcard scanner linear CCD 34, detects the bit patternprinted on the card, and converts the bit pattern into the originaldata, correcting read errors.

[0771] With no Artcard 9 inserted, the image printed from an Artcam issimply the sensed Photo Image cleaned up by any standard imageprocessing routines. The Artcard 9 is the means by which users are ableto modify a photo before printing it out. By the simple task ofinserting a specific Artcard 9 into an Artcam, a user is able to definecomplex image processing to be performed on the Photo Image.

[0772] With no Artcard inserted the Photo Image is processed in astandard way to create the Print Image. When a single Artcard 9 isinserted into the Artcam, that Artcard's effect is applied to the PhotoImage to generate the Print Image.

[0773] When the Artcard 9 is removed (ejected), the printed imagereverts to the Photo Image processed in a standard way. When the userpresses the button to eject an Artcard, an event is placed in the eventqueue maintained by the operating system running on the Artcam CentralProcessor 31. When the event is processed (for example after the currentPrint has occurred), the following things occur:

[0774] If the current Artcard is valid, then the Print Image is markedas invalid and a ‘Process Standard’ event is placed in the event queue.When the event is eventually processed it will perform the standardimage processing operations on the Photo Image to produce the PrintImage. The motor is started to eject the Artcard and a time-specific‘Stop-Motor’ Event is added to the event queue.

[0775] Inserting an Artcard

[0776] When a user inserts an Artcard 9, the Artcard Sensor 49 detectsit notifying the ACP72. This results in the software inserting an‘Artcard Inserted’ event into the event queue. When the event isprocessed several things occur:

[0777] The current Artcard is marked as invalid (as opposed to ‘none’).

[0778] The Print Image is marked as invalid.

[0779] The Artcard motor 37 is started up to load the Artcard

[0780] The Artcard Interface 87 is instructed to read the Artcard

[0781] The Artcard Interface 87 accepts signals from the Artcard scannerlinear CCD 34, detects the bit pattern printed on the card, and correctserrors in the detected bit pattern, producing a valid Artcard data blockin DRAM.

[0782] Reading Data from the Artcard CCD—General Considerations

[0783] As illustrated in FIG. 34, the Data Card reading process has 4phases operated while the pixel data is read from the card. The phasesare as follows:

[0784] Phase 1. Detect data area on Artcard

[0785] Phase 2. Detect bit pattern from Artcard based on CCD pixels, andwrite as bytes.

[0786] Phase 3. Descramble and XOR the byte-pattern

[0787] Phase 4. Decode data (Reed-Solomon decode)

[0788] As illustrated in FIG. 35, the Artcard 9 must be sampled at leastat double the printed resolution to satisfy Nyquist's Theorem. Inpractice it is better to sample at a higher rate than this. Preferably,the pixels are sampled 230 at 3 times the resolution of a printed dot ineach dimension, requiring 9 pixels to define a single dot. Thus if theresolution of the Artcard 9 is 1600 dpi, and the resolution of thesensor 34 is 4800 dpi, then using a 50 mm CCD image sensor results in9450 pixels per column. Therefore if we require 2 MB of dot data (at 9pixels per dot) then this requires 2 MB*8*9/9450=15,978columns=approximately 16,000 columns. Of course if a dot is not exactlyaligned with the sampling CCD the worst and most likely case is that adot will be sensed over a 16 pixel area (4×4) 231.

[0789] An Artcard 9 may be slightly warped due to heat damage, slightlyrotated (up to, say 1 degree) due to differences in insertion into anArtcard reader, and can have slight differences in true data rate due tofluctuations in the speed of the reader motor 37. These changes willcause columns of data from the card not to be read as correspondingcolumns of pixel data. As illustrated in FIG. 36, a 1 degree rotation inthe Artcard 9 can cause the pixels from a column on the card to be readas pixels across 166 columns:

[0790] Finally, the Artcard 9 should be read in a reasonable amount oftime with respect to the human operator. The data on the Artcard coversmost of the Artcard surface, so timing concerns can be limited to theArtcard data itself. A reading time of 1.5 seconds is adequate forArtcard reading.

[0791] The Artcard should be loaded in 1.5 seconds. Therefore all 16,000columns of pixel data must be read from the CCD 34 in 1.5 second, i.e.10,667 columns per second. Therefore the time available to read onecolumn is 1/10667 seconds, or 93,747 ns. Pixel data can be written tothe DRAM one column at a time, completely independently from anyprocesses that are reading the pixel data.

[0792] The time to write one column of data (9450/2 bytes since thereading can be 4 bits per pixel giving 2×4 bit pixels per byte) to DRAMis reduced by using 8 cache lines. If 4 lines were written out at onetime, the 4 banks can be written to independently, and thus overlaplatency reduced. Thus the 4725 bytes can be written in 11,840 ns(4725/128*320 ns). Thus the time taken to write a given column's data toDRAM uses just under 13% of the available bandwidth.

[0793] Decoding an Artcard

[0794] A simple look at the data sizes shows the impossibility offitting the process into the 8 MB of memory 33 if the entire Artcardpixel data (140 MB if each bit is read as a 3×3 array) as read by thelinear CCD 34 is kept. For this reason, the reading of the linear CCD,decoding of the bitmap, and the un-bitmap process should take place inreal-time (while the Artcard 9 is traveling past the linear CCD 34), andthese processes must effectively work without having entire data storesavailable.

[0795] When an Artcard 9 is inserted, the old stored Print Image and anyexpanded Photo Image becomes invalid. The new Artcard 9 can containdirections for creating a new image based on the currently capturedPhoto Image. The old Print Image is invalid, and the area holdingexpanded Photo Image data and image pyramid is invalid, leaving morethan 5 MB that can be used as scratch memory during the read process.Strictly speaking, the 1 MB area where the Artcard raw data is to bewritten can also be used as scratch data during the Artcard read processas long as by the time the final ReedSolomon decode is to occur, that 1MB area is free again. The reading process described here does not makeuse of the extra 1 MB area (except as a final destination for the data).

[0796] It should also be noted that the unscrambling process requirestwo sets of 2 MB areas of memory since unscrambling cannot occur inplace. Fortunately the 5 MB scratch area contains enough space for thisprocess.

[0797] Turning now to FIG. 37, there is shown a flowchart 220 of thesteps necessary to decode the Artcard data. These steps include readingin the Artcard 221, decoding the read data to produce correspondingencoded XORed scrambled bitmap data 223. Next a checkerboard XOR isapplied to the data to produces encoded scrambled data 224. This data isthen unscrambled 227 to produce data 225 before this data is subjectedto Reed-Solomon decoding to produce the original raw data 226.Alternatively, unscrambling and XOR process can take place together, notrequiring a separate pass of the data. Each of the above steps isdiscussed in further detail hereinafter. As noted previously withreference to FIG. 37, the Artcard Interface, therefore, has 4 phases,the first 2 of which are time-critical, and must take place while pixeldata is being read from the CCD:

[0798] Phase 1. Detect data area on Artcard

[0799] Phase 2. Detect bit pattern from Artcard based on CCD pixels, andwrite as bytes.

[0800] Phase 3. Descramble and XOR the byte-pattern

[0801] Phase 4. Decode data (Reed-Solomon decode)

[0802] The four phases are described in more detail as follows:

[0803] Phase 1. As the Artcard 9 moves past the CCD 34 the AI mustdetect the start of the data area by robustly detecting special targetson the Artcard to the left of the data area. If these cannot bedetected, the card is marked as invalid. The detection must occur inreal-time, while the Artcard 9 is moving past the CCD 34.

[0804] If necessary, rotation invariance can be provided. In this case,the targets are repeated on the right side of the Artcard, but relativeto the bottom right corner instead of the top corner. In this way thetargets end up in the correct orientation if the card is inserted the“wrong” way. Phase 3 below can be altered to detect the orientation ofthe data, and account for the potential rotation.

[0805] Phase 2. Once the data area has been determined, the main readprocess begins, placing pixel data from the CCD into an ‘Artcard datawindow’, detecting bits from this window, assembling the detected bitsinto bytes, and constructing a byte-image in DRAM. This must all be donewhile the Artcard is moving past the CCD.

[0806] Phase 3. Once all the pixels have been read from the Artcard dataarea, the Artcard motor 37 can be stopped, and the byte imagedescrambled and XORed. Although not requiring real-time performance, theprocess should be fast enough not to annoy the human operator. Theprocess must take 2 MB of scrambled bit-image and write theunscrambled/XORed bit-image to a separate 2 MB image.

[0807] Phase 4. The final phase in the Artcard read process is theReed-Solomon decoding process, where the 2 MB bit-image is decoded intoa 1 MB valid Artcard data area. Again, while not requiring real-timeperformance it is still necessary to decode quickly with regard to thehuman operator. If the decode process is valid, the card is marked asvalid. If the decode failed, any duplicates of data in the bit-image areattempted to be decoded, a process that is repeated until success oruntil there are no more duplicate images of the data in the bit image.

[0808] The four phase process described requires 4.5 MB of DRAM. 2 MB isreserved for Phase 2 output, and 0.5 MB is reserved for scratch dataduring phases 1 and 2. The remaining 2 MB of space can hold over 440columns at 4725 byes per column. In practice, the pixel data being readis a few columns ahead of the phase 1 algorithm, and in the worst case,about 180 columns behind phase 2, comfortably inside the 440 columnlimit.

[0809] A description of the actual operation of each phase will now beprovided in greater detail.

[0810] Phase 1—Detect Data Area on Artcard

[0811] This phase is concerned with robustly detecting the left-handside of the data area on the Artcard 9. Accurate detection of the dataarea is achieved by accurate detection of special targets printed on theleft side of the card. These targets are especially designed to be easyto detect even if rotated up to 1 degree.

[0812] Turning to FIG. 38, there is shown an enlargement of the lefthand side of an Artcard 9. The side of the card is divided into 16bands, 239 with a target eg. 241 located at the center of each band. Thebands are logical in that there is no line drawn to separate bands.Turning to FIG. 39, there is shown a single target 241. The target 241,is a printed black square containing a single white dot. The idea is todetect firstly as many targets 241 as possible, and then to join atleast 8 of the detected white-dot locations into a single logicalstraight line. If this can be done, the start of the data area 243 is afixed distance from this logical line. If it cannot be done, then thecard is rejected as invalid.

[0813] As shown in FIG. 38, the height of the card 9 is 3150 dots. Atarget (Target0) 241 is placed a fixed distance of 24 dots away from thetop left corner 244 of the data area so that it falls well within thefirst of 16 equal sized regions 239 of 192 dots (576 pixels) with notarget in the final pixel region of the card. The target 241 must be bigenough to be easy to detect, yet be small enough not to go outside theheight of the region if the card is rotated 1 degree. A suitable sizefor the target is a 31×31 dot (93×93 sensed pixels) black square 241with the white dot 242.

[0814] At the worst rotation of 1 degree, a 1 column shift occurs every57 pixels. Therefore in a 590 pixel sized band, we cannot place any partof our symbol in the top or bottom 12 pixels or so of the band or theycould be detected in the wrong band at CCD read time if the card isworst case rotated.

[0815] Therefore, if the black part of the rectangle is 57 pixels high(19 dots) we can be sure that at least 9.5 black pixels will be read inthe same column by the CCD (worst case is half the pixels are in onecolumn and half in the next). To be sure of reading at least 10 blackdots in the same column, we must have a height of 20 dots. To give roomfor erroneous detection on the edge of the start of the black dots, weincrease the number of dots to 31, giving us 15 on either side of thewhite dot at the target's local coordinate (15, 15). 31 dots is 91pixels, which at most suffers a 3 pixel shift in column, easily withinthe 576 pixel band.

[0816] Thus each target is a block of 31×31 dots (93×93 pixels) eachwith the composition:

[0817] 15 columns of 31 black dots each (45 pixel width columns of 93pixels).

[0818] 1 column of 15 black dots (45 pixels) followed by 1 white dot (3pixels) and then a further 15 black dots (45 pixels)

[0819] 15 columns of 31 black dots each (45 pixel width columns of 93pixels)

[0820] Detect Targets

[0821] Targets are detected by reading columns of pixels, one column ata time rather than by detecting dots. It is necessary to look within agiven band for a number of columns consisting of large numbers ofcontiguous black pixels to build up the left side of a target. Next, itis expected to see a white region in the center of further blackcolumns, and finally the black columns to the left of the target center.

[0822] Eight cache lines are required for good cache performance on thereading of the pixels. Each logical read fills 4 cache lines via 4sub-reads while the other 4 cache-lines are being used. This effectivelyuses up 13% of the available DRAM bandwidth.

[0823] As illustrated in FIG. 40, the detection mechanism FIFO fordetecting the targets uses a filter 245, run-length encoder 246, and aFIFO 247 that requires special wiring of the top 3 elements (S1, S2, andS3) for random access.

[0824] The columns of input pixels are processed one at a time untileither all the targets are found, or until a specified number of columnshave been processed. To process a column, the pixels are read from DRAM,passed through a filter 245 to detect a 0 or 1, and then run lengthencoded 246. The bit value and the number of contiguous bits of the samevalue are placed in FIFO 247. Each entry of the FIFO 249 is in 8 bits, 7bits 250 to hold the run-length, and 1 bit 249 to hold the value of thebit detected.

[0825] The run-length encoder 246 only encodes contiguous pixels withina 576 pixel (192 dot) region.

[0826] The top 3 elements in the FIFO 247 can be accessed 252 in anyrandom order. The run lengths (in pixels) of these entries are filteredinto 3 values: short, medium, and long in accordance with the followingtable: Short Used to detect white dot. RunLength < 16 Medium Used todetect runs of black 16 <= RunLength < above or below the white dot in48 the center of the target. Long Used to detect run lengths ofRunLength >= 48 black to the left and right of the center dot in thetarget.

[0827] Looking at the top three entries in the FIFO 247 there are 3specific cases of interest: Case 1 S1 = white long We have detected ablack column S2 = black long of the target to the left of or S3 = whitemedium/long to the right of the white center dot. Case 2 S1 = white longIf we've been processing a series S2 = black medium of columns of Case1s, then we S3 = white short have probably detected the white Previous 8columns dot in this column. We know that were Case 1 the next entry willbe black (or it would have been included in the white S3 entry), but thenumber of black pixels is in question. Need to verify by checking afterthe next FIFO advance (see Case 3). Case 3 Prev = Case 2 We havedetected part of the S3 = black med white dot. We expect around 3 ofthese, and then some more columns of Case 1.

[0828] Preferably, the following information per region band is kept:TargetDetected  1 bit BlackDetectCount  4 bits WhiteDetectCount  3 bitsPrevColumnStartPixel 15 bits TargetColumn ordinate 16 bits (15:1)TargetRow ordinate 16 bits (15:1) TOTAL  7 bytes (rounded to 8 bytes foreasy addressing)

[0829] Given a total of 7 bytes. It makes address generation easier ifthe total is assumed to be 8 bytes. Thus 16 entries requires 16*8=128bytes, which fits in 4 cache lines. The address range should be insidethe scratch 0.5 MB DRAM area since other phases make use of theremaining 4 MB data area.

[0830] When beginning to process a given pixel column, the registervalue S2StartPixel 254 is reset to 0. As entries in the FIFO advancefrom S2 to S1, they are also added 255 to the existing S2StartPixelvalue, giving the exact pixel position of the run currently defined inS2. Looking at each of the 3 cases of interest in the FIFO, S2StartPixelcan be used to determine the start of the black area of a target (Cases1 and 2), and also the start of the white dot in the center of thetarget (Case 3). An algorithm for processing columns can be as follows:1 TargetDetected[0-15] := 0 BlackDetectCount[0-15] := 0WhiteDetectCount[0-15] := 0 TargetRow[0-15] := 0 TargetColumn[0-15] := 0PrevColStartPixel[0-15] := 0 CurrentColumn := 0 2 Do ProcessColumn 3CurrentColumn++ 4 If (CurrentColumn <= LastValidColumn) Goto 2

[0831] The steps involved in the processing a column (Process Column)are as follows: 1 S2StartPixel := 0 FIFO := 0 BlackDetectCount := 0WhiteDetectCount := 0 ThisColumnDetected := FALSE PrevCaseWasCase2 :=FALSE 2 If (! TargetDetected[Target]) & (! ColumnDetected[Target])ProcessCases EndIf 3 PrevCaseWasCase2 := Case=2 4 Advance FIFO

[0832] The Processing for Each of the 3 (Process Cases) Cases is asFollows:

[0833] Case 1: BlackDetectCount[target] < 8 Δ := ABS(S2StartPixel − ORPrevColStartPixel[Target]) WhiteDetectCount[Target] = 0 If (0<=Δ< 2)BlackDetectCount[Target]++ (max value = 8) Else BlackDetectCount[Target]:= 1 WhiteDetectCount[Target] := 0 EndIf PrevColStartPixel[Target] :=S2StartPixel ColumnDetected[Target] := TRUE BitDetected = 1BlackDetectCount[target] >= 8 PrevColStartPixel[Target] := S2StartPixelWhiteDetectCount[Target] != 0 ColumnDetected[Target] := TRUE BitDetected= 1 TargetDetected[Target] := TRUE TargetColumn[Target] := CurrentColumn− 8 − (WhiteDetectCount[Target] /2)

[0834] Case 2:

[0835] No special processing is recorded except for setting the‘PrevCaseWasCase2’ flag for identifying Case 3 (see Step 3 of processinga column described above)

[0836] Case 3: PrevCaseWasCase2 = TRUE If (WhiteDetectCount[Target] < 2)BlackDetectCount[Target] >= TargetRow[Target] = S2StartPixel + 8(S2_(RunLength)/2) WhiteDetectCount=1 EndIf Δ := ABS (S2StartPixel −PrevColStartPixel [Target]) If (0<=Δ< 2) WhiteDetectCount[Target]++ ElseWhiteDetectCount[Target] := 1 EndIf PrevColStartPixel[Target] :=S2StartPixel ThisColumnDetected := TRUE BitDetected = 0

[0837] At the end of processing a given column, a comparison is made ofthe current column to the maximum number of columns for targetdetection. If the number of columns allowed has been exceeded, then itis necessary to check how many targets have been found. If fewer than 8have been found, the card is considered invalid.

[0838] Process Targets

[0839] After the targets have been detected, they should be processed.All the targets may be available or merely some of them. Some targetsmay also have been erroneously detected.

[0840] This phase of processing is to determine a mathematical line thatpasses through the center of as many targets as possible. The moretargets that the line passes through, the more confident the targetposition has been found. The limit is set to be 8 targets. If a linepasses through at least 8 targets, then it is taken to be the right one.

[0841] It is all right to take a brute-force but straightforwardapproach since there is the time to do so (see below), and loweringcomplexity makes testing easier. It is necessary to determine the linebetween targets 0 and 1 (if both targets are considered valid) and thendetermine how many targets fall on this line. Then we determine the linebetween targets 0 and 2, and repeat the process. Eventually we do thesame for the line between targets 1 and 2, 1 and 3 etc. and finally forthe line between targets 14 and 15. Assuming all the targets have beenfound, we need to perform 15+14+13+. . . =90 sets of calculations (witheach set of calculations requiring 16 tests=1440 actual calculations),and choose the line which has the maximum number of targets found alongthe line. The algorithm for target location can be as follows: TargetA:= 0 MaxFound := 0 BestLine := 0 While (TargetA < 15) If (TargetA isValid) TargetB:= TargetA + 1 While (TargetB<= 15) If (TargetB is valid)CurrentLine := line between TargetA and TargetB TargetC := 0; While(TargetC <= 15) If (TargetC valid AND TargetC on line AB) TargetsHit++EndIf If (TargetsHit > MaxFound) MaxFound := TargetsHit BestLine :=CurrentLine EndIf TargetC++ EndWhile EndIf TargetB ++ EndWhile EndIfTargetA++ EndWhile If (MaxFound < 8) Card is Invalid Else Store expectedcentroids for rows based on BestLine EndIf

[0842] As illustrated in FIG. 34, in the algorithm above, to determine aCurrentLine 260 from Target A 261 and target B, it is necessary tocalculate Δrow (264) & Δcolumn (263) between targets 261, 262, and thelocation of Target A. It is then possible to move from Target 0 toTarget 1 etc. by adding Δrow and Δcolumn. The found (if actually found)location of target N can be compared to the calculated expected positionof Target N on the line, and if it falls within the tolerance, thenTarget N is determined to be on the line.

[0843] To calculate Δrow & Δcolumn:

Δrow=(row_(TargetA)−row_(TargetB))/(B−A)

Δcolumn=(column_(TargetA)−column_(TargetB))/(B−A)

[0844] Then we calculate the position of Target0:

row=rowTargetA−(A*Δrow)

column=columnTargetA−(A*Δcolumn)

[0845] And compare (row, column) against the actual row_(Target0) andcolumn_(Target0). To move from one expected target to the next (e.g.from Target0 to Target1), we simply add Δrow and Δcolumn to row andcolumn respectively. To check if each target is on the line, we mustcalculate the expected position of Target0, and then perform one add andone comparison for each target ordinate.

[0846] At the end of comparing all 16 targets against a maximum of 90lines, the result is the best line through the valid targets. If thatline passes through at least 8 targets (i.e. MaxFound >=8), it can besaid that enough targets have been found to form a line, and thus thecard can be processed. If the best line passes through fewer than 8,then the card is considered invalid.

[0847] The resulting algorithm takes 180 divides to calculate Δrow andΔcolumn, 180 multiply/adds to calculate target0 position, and then 2880adds/comparisons. The time we have to perform this processing is thetime taken to read 36 columns of pixel data=3,374,892 ns. Not evenaccounting for the fact that an add takes less time than a divide, it isnecessary to perform 3240 mathematical operations in 3,374,892 ns. Thatgives approximately 1040 ns per operation, or 104 cycles. The CPU cantherefore safely perform the entire processing of targets, reducingcomplexity of design.

[0848] Update Centroids Based on Data Edge Border and Clockmarks

[0849] Step 0: Locate the Data Area

[0850] From Target 0 (241 of FIG. 38) it is a predetermined fixeddistance in rows and columns to the top left border 244 of the dataarea, and then a further 1 dot column to the vertical clock marks 276.So we use TargetA, Δrow and Δcolumn found in the previous stage (Δrowand Δcolumn refer to distances between targets) to calculate thecentroid or expected location for Target0 as described previously.

[0851] Since the fixed pixel offset from Target0 to the data area isrelated to the distance between targets (192 dots between targets, and24 dots between Target0 and the data area 243), simply add Δrow/8 toTarget0's centroid column coordinate (aspect ratio of dots is 1:1). Thusthe top coordinate can be defined as:

(column_(DotColumnTop)=column_(Target0)+(Δrow/8)

(row_(DotColumnTop)=row_(Target)0+(Δcolumn/8)

[0852] Next Δrow and Δcolumn are updated to give the number of pixelsbetween dots in a single column (instead of between targets) by dividingthem by the number of dots between targets:

Δrow=Δrow/192

Δcolumn=Δcolumn/192

[0853] We also set the currentColumn register (see Phase 2) to be −1 sothat after step 2, when phase 2 begins, the currentColumn register willincrement from −1 to 0.

[0854] Step 1: Write Out the Initial Centroid Deltas (Δ) and Bit History

[0855] This simply involves writing setup information required for Phase2.

[0856] This can be achieved by writing 0s to all the Δrow and Δcolumnentries for each row, and a bit history. The bit history is actually anexpected bit history since it is known that to the left of the clockmark column 276 is a border column 277, and before that, a white area.The bit history therefore is 011, 010, 011, 010 etc.

[0857] Step 2: Update the Centroids Based on Actual Pixels Read.

[0858] The bit history is set up in Step 1 according to the expectedclock marks and data border. The actual centroids for each dot row cannow be more accurately set (they were initially 0) by comparing theexpected data against the actual pixel values. The centroid updatingmechanism is achieved by simply performing step 3 of Phase 2.

[0859] Phase 2—Detect Bit Pattern from Artcard Based on Pixels Read, andWrite as Bytes.

[0860] Since a dot from the Artcard 9 requires a minimum of 9 sensedpixels over 3 columns to be represented, there is little point inperforming dot detection calculations every sensed pixel column. It isbetter to average the time required for processing over the average dotoccurrence, and thus make the most of the available processing time.This allows processing of a column of dots from an Artcard 9 in the timeit takes to read 3 columns of data from the Artcard. Although the mostlikely case is that it takes 4 columns to represent a dot, the 4^(th)column will be the last column of one dot and the first column of a nextdot. Processing should therefore be limited to only 3 columns.

[0861] As the pixels from the CCD are written to the DRAM in 13% of thetime available, 83% of the time is available for processing of 1 columnof dots i.e. 83% of (93,747*3)=83% of 281,241 ns=233,430 ns.

[0862] In the available time, it is necessary to detect 3150 dots, andwrite their bit values into the raw data area of memory. The processingtherefore requires the following steps:

[0863] For each column of dots on the Artcard:

[0864] Step 0: Advance to the next dot column

[0865] Step 1: Detect the top and bottom of an Artcard dot column (checkclock marks)

[0866] Step 2: Process the dot column, detecting bits and storing themappropriately

[0867] Step 3: Update the centroids

[0868] Since we are processing the Artcard's logical dot columns, andthese may shift over 165 pixels, the worst case is that we cannotprocess the first column until at least 165 columns have been read intoDRAM. Phase 2 would therefore finish the same amount of time after theread process had terminated. The worst case time is: 165*93,747ns=15,468,255 ns or 0.015 seconds.

[0869] Step 0: Advance to the Next Dot Column

[0870] In order to advance to the next column of dots we add Δrow andΔcolumn to the dotColumnTop to give us the centroid of the dot at thetop of the column. The first time we do this, we are currently at theclock marks column 276 to the left of the bit image data area, and so weadvance to the first column of data. Since Δrow and Δcolumn refer todistance between dots within a column, to move between dot columns it isnecessary to add Δrow to column_(dotColumnTop) and Δcolumn torow_(dotcolumnTop).

[0871] To keep track of what column number is being processed, thecolumn number is recorded in a register called CurrentColumn. Every timethe sensor advances to the next dot column it is necessary to incrementthe CurrentColumn register. The first time it is incremented, it isincremented from −1 to 0 (see Step 0 Phase 1). The CurrentColumnregister determines when to terminate the read process (when reachingmaxColumns), and also is used to advance the DataOut Pointer to the nextcolumn of byte information once all 8 bits have been written to the byte(once every 8 dot columns). The lower 3 bits determine what bit we're upto within the current byte. It will be the same bit being written forthe whole column.

[0872] Step 1: Detect the Top and Bottom of an Artcard Dot Column.

[0873] In order to process a dot column from an Artcard, it is necessaryto detect the top and bottom of a column. The column should form astraight line between the top and bottom of the column (except for localwarping etc.). Initially dotColumnTop points to the clock mark column276. We simply toggle the expected value, write it out into the bithistory, and move on to step 2, whose first task will be to add the Δrowand Δcolumn values to dotColumnTop to arrive at the first data dot ofthe column.

[0874] Step 2: Process an Artcard's Dot Column

[0875] Given the centroids of the top and bottom of a column in pixelcoordinates the column should form a straight line between them, withpossible minor variances due to warping etc.

[0876] Assuming the processing is to start at the top of a column (atthe top centroid coordinate) and move down to the bottom of the column,subsequent expected dot centroids are given as:

row_(next)=row+Δrow

column_(next)=column+Δcolumn

[0877] This gives us the address of the expected centroid for the nextdot of the column. However to account for local warping and error we addanother Δrow and Δcolumn based on the last time we found the dot in agiven row. In this way we can account for small drifts that accumulateinto a maximum drift of some percentage from the straight line joiningthe top of the column to the bottom.

[0878]

[0879] We therefore keep 2 values for each row, but store them inseparate tables since the row history is used in step 3 of this phase.

[0880] Δrow and Δcolumn (2@4 bits each=1 byte)

[0881] row history (3 bits per row, 2 rows are stored per byte)

[0882] For each row we need to read a Δrow and Δcolumn to determine thechange to the centroid. The read process takes 5% of the bandwidth and 2cache lines:

76*(3150/32)+2*3150=13,824 ns=5% of bandwidth

[0883] Once the centroid has been determined, the pixels around thecentroid need to be examined to detect the status of the dot and hencethe value of the bit. In the worst case a dot covers a 4×4 pixel area.However, thanks to the fact that we are sampling at 3 times theresolution of the dot, the number of pixels required to detect thestatus of the dot and hence the bit value is much less than this. Weonly require access to 3 columns of pixel columns at any one time.

[0884] In the worst case of pixel drift due to a 1% rotation, centroidswill shift 1 column every 57 pixel rows, but since a dot is 3 pixels indiameter, a given column will be valid for 171 pixel rows (3*57). As abyte contains 2 pixels, the number of bytes valid in each buffered read(4 cache lines) will be a worst case of 86 (out of 128 read).

[0885] Once the bit has been detected it must be written out to DRAM. Westore the bits from 8 columns as a set of contiguous bytes to minimizeDRAM delay. Since all the bits from a given dot column will correspondto the next bit position in a data byte, we can read the old value forthe byte, shift and OR in the new bit, and write the byte back. Theread/shift&OR/write process requires 2 cache lines.

[0886] We need to read and write the bit history for the given row as weupdate it. We only require 3 bits of history per row, allowing thestorage of 2 rows of history in a single byte. The read/shift&OR/writeprocess requires 2 cache lines.

[0887] The total bandwidth required for the bit detection and storage issummarised in the following table: Read centroid Δ  5% Read 3 columns ofpixel data 19% Read/Write detected bits into byte buffer 10% Read/Writebit history  5% TOTAL 39%

[0888] Detecting a Dot

[0889] The process of detecting the value of a dot (and hence the valueof a bit) given a centroid is accomplished by examining 3 pixel valuesand getting the result from a lookup table. The process is fairly simpleand is illustrated in FIG. 42. A dot 290 has a radius of about 1.5pixels. Therefore the pixel 291 that holds the centroid, regardless ofthe actual position of the centroid within that pixel, should be 100% ofthe dot's value. If the centroid is exactly in the center of the pixel291, then the pixels above 292 & below 293 the centroid's pixel, as wellas the pixels to the left 294 & right 295 of the centroid's pixel willcontain a majority of the dot's value. The further a centroid is awayfrom the exact center of the pixel 295, the more likely that more thanthe center pixel will have 100% coverage by the dot.

[0890] Although FIG. 42 only shows centroids differing to the left andbelow the center, the same relationship obviously holds for centroidsabove and to the right of center. center. In Case 1, the centroid isexactly in the center of the middle pixel 295. The center pixel 295 iscompletely covered by the dot, and the pixels above, below, left, andright are also well covered by the dot. In Case 2, the centroid is tothe left of the center of the middle pixel 291. The center pixel isstill completely covered by the dot, and the pixel 294 to the left ofthe center is now completely covered by the dot. The pixels above 292and below 293 are still well covered. In Case 3, the centroid is belowthe center of the middle pixel 291. The center pixel 291 is stillcompletely covered by the dot 291, and the pixel below center is nowcompletely covered by the dot. The pixels left 294 and right 295 ofcenter are still well covered. In Case 4, the centroid is left and belowthe center of the middle pixel. The center pixel 291 is still completelycovered by the dot, and both the pixel to the left of center 294 and thepixel below center 293 are completely covered by the dot.

[0891] The algorithm for updating the centroid uses the distance of thecentroid from the center of the middle pixel 291 in order to select 3representative pixels and thus decide the value of the dot:

[0892] Pixel 1: the pixel containing the centroid

[0893] Pixel 2: the pixel to the left of Pixel 1 if the centroid's Xcoordinate (column value) is <½, otherwise the pixel to the right ofPixel 1.

[0894] Pixel 3: the pixel above pixel 1 if the centroid's Y coordinate(row value) is <½, otherwise the pixel below Pixel 1.

[0895] As shown in FIG. 43, the value of each pixel is output to apre-calculated lookup table 301. The 3 pixels are fed into a 12-bitlookup table, which outputs a single bit indicating the value of thedot—on or off. The lookup table 301 is constructed at chip definitiontime, and can be compiled into about 500 gates. The lookup table can bea simple threshold table, with the exception that the center pixel(Pixel 1) is weighted more heavily.

[0896] Step 3: Update the Centroid Δs for Each Row in the Column

[0897] The idea of the Δs processing is to use the previous bit historyto generate a ‘perfect’ dot at the expected centroid location for eachrow in a current column. The actual pixels (from the CCD) are comparedwith the expected ‘perfect’ pixels. If the two match, then the actualcentroid location must be exactly in the expected position, so thecentroid Δs must be valid and not need updating. Otherwise a process ofchanging the centroid Δs needs to occur in order to best fit theexpected centroid location to the actual data. The new centroid Δs willbe used for processing the dot in the next column.

[0898] Updating the centroid Δs is done as a subsequent process fromStep 2 for the following reasons:

[0899] to reduce complexity in design, so that it can be performed asStep 2 of Phase 1 there is enough bandwidth remaining to allow it toallow reuse of DRAM buffers, and

[0900] to ensure that all the data required for centroid updating isavailable at the start of the process without special pipelining.

[0901] The centroid Δ are processed as Δcolumn Δrow respectively toreduce complexity.

[0902] Although a given dot is 3 pixels in diameter, it is likely tooccur in a 4×4 pixel area. However the edge of one dot will as a resultbe in the same pixel as the edge of the next dot. For this reason,centroid updating requires more than simply the information about agiven single dot.

[0903]FIG. 44 shows a single dot 310 from the previous column with agiven centroid 311. In this example, the dot 310 extend Δ over 4 pixelcolumns 312-315 and in fact, part of the previous dot column's dot(coordinate=(Prevcolumn, Current Row)) has entered the current columnfor the dot on the current row. If the dot in the current row and columnwas white, we would expect the rightmost pixel column 314 from theprevious dot column to be a low value, since there is only the dotinformation from the previous column's dot (the current column's dot iswhite). From this we can see that the higher the pixel value is in thispixel column 315, the more the centroid should be to the right Ofcourse, if the dot to the right was also black, we cannot adjust thecentroid as we cannot get information sub-pixel. The same can be saidfor the dots to the left, above and below the dot at dot coordinates(PrevColumn, CurrentRow).

[0904] From this we can say that a maximum of 5 pixel columns and rowsare required. It is possible to simplify the situation by taking thecases of row and column centroid As separately, treating them as thesame problem, only rotated 90 degrees.

[0905] Taking the horizontal case first, it is necessary to change thecolumn centroid Δs if the expected pixels don't match the detectedpixels. From the bit history, the value of the bits found for theCurrent Row in the current dot column, the previous dot column, and the(previous-1) th dot column are known. The expected centroid location isalso known. Using these two pieces of information, it is possible togenerate a 20 bit expected bit pattern should the read be ‘perfect’. The20 bit bit-pattern represents the expected Δ values for each of the 5pixels across the horizontal dimension. The first nibble would representthe rightmost pixel of the leftmost dot. The next 3 nibbles representthe 3 pixels across the center of the dot 310 from the previous column,and the last nibble would be the leftmost pixel 317 of the rightmost dot(from the current column).

[0906] If the expected centroid is in the center of the pixel, we wouldexpect a 20 bit pattern based on the following table: Bit Expectedhistory pixels 000 00000 001 0000D 010 0DFD0 011 0DFDD 100 D0000 101D000D 110 DDFD0 111 DDFDD

[0907] The pixels to the left and right of the center dot are either 0or D depending on whether the bit was a 0 or 1 respectively. The centerthree pixels are either 000 or DFD depending on whether the bit was a 0or 1 respectively. These values are based on the physical area taken bya dot for a given pixel. Depending on the distance of the centroid fromthe exact center of the pixel, we would expect data shifted slightly,which really only effects the pixels either side of the center pixel.Since there are 16 possibilities, it is possible to divide the distancefrom the center by 16 and use that amount to shift the expected pixels.

[0908] Once the 20 bit 5 pixel expected value has been determined it canbe compared against the actual pixels read. This can proceed bysubtracting the expected pixels from the actual pixels read on a pixelby pixel basis, and finally adding the differences together to obtain adistance from the expected Δ values.

[0909]Fig. 45 illustrates one form of implementation of the abovealgorithm which includes a look up table 320 which receives the bithistory 322 and central fractional component 323 and outputs 324 thecorresponding 20 bit number which is subtracted 321 from the centralpixel input 326 to produce a pixel difference 327.

[0910] This process is carried out for the expected centroid and oncefor a Shift of the centroid left and right by 1 amount in Δcolumn. Thecentroid with the smallest difference from the actual pixels isconsidered to be the ‘winner’ and the Δcolumn updated accordingly (whichhopefully is ‘no change’) As a result, a Δcolumn cannot change by morethan 1 each dot column.

[0911] The process is repeated for the vertical pixels, and Δrow isconsequentially updated.

[0912] There is a large amount of scope here for parallelism. Dependingon the rate of the clock chosen for the ACP unit 31 these units can beplaced in series (and thus the testing of 3 different Δ could occur inconsecutive clock cycles), or in parallel where all 3 can be testedsimultaneously. If the clock rate is fast enough, there is less need forparallelism.

[0913] Bandwidth Utilization

[0914] It is necessary to read the old Δ of the Δs, and to write themout again. This takes 10% of the bandwidth:

2*(76(3150/32)+2*3150)=27,648 ns=10% of bandwidth

[0915] It is necessary to read the bit history for the given row as weupdate its Δs. Each byte contains 2 row's bit histories, thus taking2.5% of the bandwidth:

76((3150/2)/32)+2*(3150/2)=4,085 ns=2.5% of bandwidth

[0916] In the worst case of pixel drift due to a 1% rotation, centroidswill shift 1 column every 57 pixel rows, but since a dot is 3 pixels indiameter, a given pixel column will be valid for 171 pixel rows (3*57).As a byte contains 2 pixels, the number of bytes valid in cached readswill be a worst case of 86 (out of 128 read). The worst case timing for5 columns is therefore 31% bandwidth.

5*(((9450/(128* 2))*320)*128/86)=88, 112 ns=31% of bandwidth.

[0917] The total bandwidth required for the updating the centroid Δ issummarised in the following table: Read/Write centroid Δ 10% Read bithistory 2.5%  Read 5 columns of pixel data 31% TOTAL 43.5%  

[0918] Memory Usage for Phase 2:

[0919] The 2 MB bit-image DRAM area is read from and written to duringPhase 2 processing. The 2 MB pixel-data DRAM area is read.

[0920] The 0.5 MB scratch DRAM area is used for storing row data,namely: Centroid array 24 bits (16:8) * 2 * 3150 = 18,900 byes BitHistory array 3 bits * 3150 entries (2 per byte) = 1575 bytes

[0921] Phase 3—Unscramble and XOR the Raw Data

[0922] Returning to FIG. 37, the next step in decoding is to unscrambleand XOR the raw data. The 2 MB byte image, as taken from the Artcard, isin a scrambled XORed form. It must be unscrambled and re-XORed toretrieve the bit image necessary for the Reed Solomon decoder in phase4.

[0923] Turning to FIG. 46, the unscrambling process 330 takes a 2 MBscrambled byte image 331 and writes an unscrambled 2 MB image 332. Theprocess cannot reasonably be performed in-place, so 2 sets of 2 MB areasare utilised. The scrambled data 331 is in symbol block order arrangedin a 16×16 array, with symbol block 0 (334) having all the symbol 0'sfrom all the code words in random order. Symbol block 1 has all thesymbol 1's from all the code words in random order etc. Since there areonly 255 symbols, the 256^(th) symbol block is currently unused.

[0924] A linear feedback shift register is used to determine therelationship between the position within a symbol block eg. 334 and whatcode word eg. 355 it came from. This works as long as the same seed isused when generating the original Artcard images. The XOR of bytes fromalternative source lines with 0×AA and 0×55 respectively is effectivelyfree (in time) since the bottleneck of time is waiting for the DRAM tobe ready to read/write to non-sequential addresses.

[0925] The timing of the unscrambling XOR process is effectively 2 MB ofrandom byte-reads, and 2 MB of random byte-writes i.e. 2*(2 MB*76 ns+2MB *2 ns)=327,155,712 ns or approximately 0.33 seconds. This timingassumes no caching.

[0926] Phase 4—Reed Solomon Decode

[0927] This phase is a loop, iterating through copies of the data in thebit image, passing them to the Reed-Solomon decode module until either asuccessful decode is made or until there are no more copies to attemptdecode from.

[0928] The Reed-Solomon decoder used can be the VLIW processor, suitablyprogrammed or, alternatively, a separate hardwired core such as LSILogic's L64712. The L64712 has a throughput of 50 Mbits per second(around 6.25 MB per second), so the time may be bound by the speed ofthe Reed-Solomon decoder rather than the 2 MB read and 1 MB write memoryaccess time (500 MB/sec for sequential accesses). The time taken in theworst case is thus 2/6.25 s=approximately 0.32 seconds.

[0929] Phase 5 Running the Vark Script

[0930] The overall time taken to read the Artcard 9 and decode it istherefore approximately 2.15 seconds. The apparent delay to the user isactually only 0.65 seconds (the total of Phases 3 and 4), since theArtcard stops moving after 1.5 seconds.

[0931] Once the Artcard is loaded, the Artvark script must beinterpreted, Rather than run the script immediately, the script is onlyrun upon the pressing of the ‘Print’ button 13 (FIG. 1). The taken torun the script will vary depending on the complexity of the script, andmust be taken into account for the perceived delay between pressing theprint button and the actual print button and the actual printing.

[0932] Alternative Artcard Fomat

[0933] Of course, other artcard formats are possible. There will now bedescribed one such alternative artcard format with a number ofpreferable feature. Described hereinafter will be the alternativeArtcard data format, a mechanism for mapping user data onto dots on analternative Artcard, and a fast alternative Artcard reading algorithmfor use in embedded systems where resources are scarce.

[0934] Alternative Artoard Overview

[0935] The Alternative Artcards can be used in both embedded and PC typeapplications, providing a user-friendly interface to large amounts ofdata or configuration information.

[0936] While the back side of an alternative Artcard has the same visualappearance regardless of the application (since it stores the data), thefront of an alternative Artcard can be application dependent. It mustmake sense to the user in the context of the application.

[0937] Alternative Artcard technology can also be independent of theprinting resolution. The notion of storing data as dots on a card simplymeans that if it is possible put more dots in the same space (byincreasing resolution), then those dots can represent more data. Thepreferred embodiment assumes utilisation of 1600 dpi printing on a 86mm×55 mm card as the sample Artcard, but it is simple to determinealternative equivalent layouts and data sizes for other card sizesand/or other print resolutions. Regardless of the print resolution, thereading technique remain the same. After all decoding and other overheadhas been taken into account, alternative Artcards are capable of storingup to 1 Megabyte of data at print resolutions up to 1600 dpi.Alternative Artcards can store megabytes of data at print resolutionsgreater than 1600 dpi. The following two tables summarize the effectivealternative Artcard data storage capacity for certain print resolutions:

[0938] Format of an Alternative Artcard

[0939] The structure of data on the alternative Artcard is thereforespecifically designed to aid the recovery of data. This sectiondescribes the format of the data (back) side of an alternative Artcard.

[0940] Dots

[0941] The dots on the data side of an alternative Artcard can bemonochrome. For example, black dots printed on a white background at apredetermined desired print resolution. Consequently a “black dot” isphysically different from a “white dot”. FIG. 47 illustrates variousexamples of magnified views of black and white dots. The monochromaticscheme of black dots on a white background is preferably chosen tomaximize dynamic range in blurry reading environments. Although theblack dots are printed at a particular pitch (eg. 1600 dpi), the dotsthemselves are slightly larger in order to create continuous lines whendots are printed contiguously. In the example images of FIG. 47, thedots are not as merged as they may be in reality as a result ofbleeding. There would be more smoothing out of the black indentations.Although the alternative Artcard system described in the preferredembodiment allows for flexibly different dot sizes, exact dot sizes andink/printing behaviour for a particular printing technology should bestudied in more detail in order to obtain best results.

[0942] In describing this artcard embodiment, the term dot refers to aphysical printed dot (ink, thermal, electro-photographic, silver-halideetc) on an alternative Artcard. When an alternative Artcard reader scansan alternative Artcard, the dots must be sampled at least double theprinted resolution to satisfy Nyquist's Theorem. The term pixel refersto a sample value from an alternative Artcard reader device. Forexample, when 1600 dpi dots are scanned at 4800 dpi there are 3 pixelsin each dimension of a dot, or 9 pixels per dot. The sampling processwill be further explained hereinafter.

[0943] Turning to FIG. 48, there is shown the data surface 1101 a sampleof alternative Artcard. Each alternative Artcard consists of an “active”region 1102 surrounded by a white border region 1103. The white border1103 contains no data information, but can be used by an alternativeArtcard reader to calibrate white levels. The active region is an arrayof data blocks eg. 1104, with each data block separated from the next bya gap of 8 white dots eg. 1106. Depending on the print resolution, thenumber of data blocks on an alternative Artcard will vary. On a 1600 dpialternative Artcard, the array can be 8×8. Each data block 1104 hasdimensions of 627×394 dots. With an inter-block gap 1106 of 8 whitedots, the active area of an alternative Artcard is therefore 5072×3208dots (8.1 mm×5.1 mm at 1600 dpi).

[0944] Data Blocks

[0945] Turning now to FIG. 49, there is shown a single data block 1107.The active region of an alternative Artcard consists of an array ofidentically structured data blocks 1107. Each of the data blocks has thefollowing structure: a data region 1108 surrounded by clock-marks 1109,borders 1110, and targets 1111. The data region holds the encoded dataproper, while the clock-marks, borders and targets are presentspecifically to help locate the data region and ensure accurate recoveryof data from within the region.

[0946] Each data block 1107 has dimensions of 627×394 dots. Of this, thecentral area of 595×384 dots is the data region 1108. The surroundingdots are used to hold the clock-marks, borders, and targets.

[0947] Borders and Clockmarks

[0948]FIG. 50 illustrates a data block with FIG. 51 and FIG. 52illustrating magnified edge portions thereof. As illustrated in FIG. 51and FIG. 52, there are two 5 dot high border and clockmark regions 1170,1177 in each data block: one above and one below the data region. Forexample, The top 5 dot high region consists of an outer black dot borderline 1112 (which stretches the length of the data block), a white dotseparator line 1113 (to ensure the border line is independent), and a 3dot high set of clock marks 1114. The clock marks alternate between awhite and black row, starting with a black clock mark at the 8th columnfrom either end of the data block. There is no separation betweenclockmark dots and dots in the data region.

[0949] The clock marks are symmetric in that if the alternative Artcardis inserted rotated 180 degrees, the same relative border/clockmarkregions will be encountered. The border 1112, 1113 is intended for useby an alternative Artcard reader to keep vertical tracking as data isread from the data region. The clockmarks 1114 are intended to keephorizontal tracking as data is read from the data region. The separationbetween the border and clockmarks by a white line of dots is desirableas a result of blurring occurring during reading. The border thusbecomes a black line with white on either side, making for a goodfrequency response on reading. The clockmarks alternating between whiteand black have a similar result, except in the horizontal rather thanthe vertical dimension. Any alternative Artcard reader must locate theclockmarks and border if it intends to use them for tracking. The nextsection deals with targets, which are designed to point the way to theclockmarks, border and data.

[0950] Targets in the Target Region

[0951] As shown in FIG. 54, there are two 15-dot wide target regions1116, 1117 in each data block: one to the left and one to the right ofthe data region. The target regions are separated from the data regionby a single column of dots used for orientation. The purpose of theTarget Regions 1116, 1117 is to point the way to the clockmarks, borderand data regions. Each Target Region contains 6 targets eg. 1118 thatare designed to be easy to find by an alternative Artcard reader.Turning now to FIG. 53 there is shown the structure of a single target1120. Each target 1120 is a 15×15 dot black square with a centerstructure 1121 and a run-length encoded target number 1122. The centerstructure 1121 is a simple white cross, and the target number component1122 is simply two columns of white dots, each being 2 dots long foreach part of the target number. Thus target number 1's target id 1122 is2 dots long, target number 2's target id 1122 is 4 dots wide etc.

[0952] As shown in FIG. 54, the targets are arranged so that they arerotation invariant with regards to card insertion. This means that theleft targets and right targets are the same, except rotated 180 degrees.In the left Target Region 1116, the targets are arranged such thattargets 1 to 6 are located top to bottom respectively. In the rightTarget Region, the targets are arranged so that target numbers 1 to 6are located bottom to top. The target number id is always in the halfclosest to the data region. The magnified view portions of FIG. 54reveals clearly the how the right targets are simply the same as theleft targets, except rotated 180 degrees.

[0953] As shown in FIG. 55, the targets 1124, 1125 are specificallyplaced within the Target Region with centers 55 dots apart. In addition,there is a distance of 55 dots from the center of target 1 (1124) to thefirst clockmark dot 1126 in the upper clockmark region, and a distanceof 55 dots from the center of the target to the first clockmark dot inthe lower clockmark region (not shown). The first black clockmark inboth regions begins directly in line with the target center (the 8th dotposition is the center of the 15 dot-wide target).

[0954] The simplified schematic illustrations of FIG. 55 illustrates thedistances between target centers as well as the distance from Target 1(1124) to the first dot of the first black clockmark (1126) in the upperborder/clockmark region. Since there is a distance of 55 dots to theclockmarks from both the upper and lower targets, and both sides of thealternative Artcard are symmetrical (rotated through 180 degrees), thecard can be read left-to-right or right-to-left. Regardless of readingdirection, the orientation does need to be determined in order toextract the data from the data region.

[0955] Orientation Columns

[0956] As illustrated in FIG. 56, there are two 1 dot wide OrientationColumns 1127, 1128 in each data block: one directly to the left and onedirectly to the right of the data region. The Orientation Columns arepresent to give orientation information to an alternative Artcardreader: On the left side of the data region (to the right of the LeftTargets) is a single column of white dots 1127. On the right side of thedata region (to the left of the Right Targets) is a single column ofblack dots 1128. Since the targets are rotation invariant, these twocolumns of dots allow an alternative Artcard reader to determine theorientation of the alternative Artcard—has the card been inserted theright way, or back to front.

[0957] From the alternative Artcard reader's point of view, assuming nodegradation to the dots, there are two possibilities:

[0958] If the column of dots to the left of the data region is white,and the column to the right of the data region is black, then the readerwill know that the card has been inserted the same way as it waswritten.

[0959] If the column of dots to the left of the data region is black,and the column to the right of the data region is white, then the readerwill know that the card has been inserted backwards, and the data regionis appropriately rotated. The reader must take appropriate action tocorrectly recover the information from the alternative Artcard.

[0960] Data Region

[0961] As shown in FIG. 57, the data region of a data block consists of595 columns of 384 dots each, for a total of 228,480 dots. These dotsmust be interpreted and decoded to yield the original data. Each dotrepresents a single bit, so the 228,480 dots represent 228,480 bits, or28,560 bytes. The interpretation of each dot can be as follows: Black 1White 0

[0962] The actual interpretation of the bits derived from the dots,however, requires understanding of the mapping from the original data tothe dots in the data regions of the alternative Artcard.

[0963] Mapping Original Data to Data Region Dots

[0964] There will now be described the process of taking an originaldata file of maximum size 910,082 bytes and mapping it to the dots inthe data regions of the 64 data blocks on a 1600 dpi alternativeArtcard. An alternative Artcard reader would reverse the process inorder to extract the original data from the dots on an alternativeArtcard. At first glance it seems trivial to map data onto dots: binarydata is comprised of is and Os, so it would be possible to simply writeblack and white dots onto the card. This scheme however, does not allowfor the fact that ink can fade, parts of a card may be damaged withdirt, grime, or even scratches. Without error-detection encoding, thereis no way to detect if the data retrieved from the card is correct. Andwithout redundancy encoding, there is no way to correct the detectederrors. The aim of the mapping process then, is to make the datarecovery highly robust, and also give the alternative Artcard reader theability to know it read the data correctly.

[0965] There are three basic steps involved in mapping an original datafile to data region dots:

[0966] Redundancy encode the original data

[0967] Shuffle the encoded data in a deterministic way to reduce theeffect of localized alternative Artcard damage

[0968] Write out the shuffled, encoded data as dots to the data blockson the alternative Artcard

[0969] Each of these steps is examined in detail in the followingsections.

[0970] Redundancy Encode Using Reed-Solomon Encoding

[0971] The mapping of data to alternative Artcard dots relies heavily onthe method of redundancy encoding employed. Reed-Solomon encoding ispreferably chosen for its ability to deal with burst errors andeffectively detect and correct errors using a minimum of redundancy.Reed Solomon encoding is adequately discussed in the standard texts suchas Wicker, S., and Bhargava, V., 1994, Reed-Solomon Codes and theirApplications, IEEE Press. Rorabaugh, C, 1996, Error Coding Cookbook,McGraw-Hill. Lyppens, H., 1997, Reed-Solomon Error Correction, Dr.Dobb's Journal, January 1997 (Volume 22, Issue 1).

[0972] A variety of different parameters for Reed-Solomon encoding canbe used, including different symbol sizes and different levels ofredundancy. Preferably, the following encoding parameters are used:

[0973] m=8

[0974] t=64

[0975] Having m=8 means that the symbol size is 8 bits (1 byte). It alsomeans that each Reed-Solomon encoded block size n is 255 bytes (2⁸−1symbols). In order to allow correction of up to t symbols, 2t symbols inthe final block size must be taken up with redundancy symbols. Havingt=64 means that 64 bytes (symbols) can be corrected per block if theyare in error. Each 255 byte block therefore has 128 (2×64) redundancybytes, and the remaining 127 bytes (k=127) are used to hold originaldata. Thus:

[0976] n=255

[0977] k=127

[0978] The practical result is that 127 bytes of original data areencoded to become a 255-byte block of Reed-Solomon encoded data. Theencoded 255-byte blocks are stored on the alternative Artcard and laterdecoded back to the original 127 bytes again by the alternative Artcardreader. The 384 dots in a single column of a data block's data regioncan hold 48 bytes (384/8). 595 of these columns can hold 28,560 bytes.This amounts to 112 Reed-Solomon blocks (each block having 255 bytes).The 64 data blocks of a complete alternative Artcard can hold a total of7168 Reed-Solomon blocks (1,827,840 bytes, at 255 bytes per Reed-Solomonblock). Two of the 7,168 Reed-Solomon blocks are reserved for controlinformation, but the remaining 7166 are used to store data. Since eachReed-Solomon block holds 127 bytes of actual data, the total amount ofdata that can be stored on an alternative Artcard is 910,082 bytes(7166×127). If the original data is less than this amount, the data canbe encoded to fit an exact number of Reed-Solomon blocks, and then theencoded blocks can be replicated until all 7,166 are used. FIG. 58illustrates the overall form of encoding utilised.

[0979] Each of the 2 Control blocks 1132, 1133 contain the same encodedinformation required for decoding the remaining 7,166 Reed-Solomonblocks:

[0980] The number of Reed-Solomon blocks in a full message (16 bitsstored lo/hi), and

[0981] The number of data bytes in the last Reed-Solomon block of themessage (8 bits)

[0982] These two numbers are repeated 32 times (consuming. 96 bytes)with the remaining 31 bytes reserved and set to 0. Each control block isthen Reed-Solomon encoded, turning the 127 bytes of control informationinto 255 bytes of Reed-Solomon encoded data.

[0983] The Control Block is stored twice to give greater chance of itsurviving. In addition, the repetition of the data within the ControlBlock has particular significance when using Reed-Solomon encoding. Inan uncorrupted Reed-Solomon encoded block, the first 127 bytes of dataare exactly the original data, and can be looked at in an attempt torecover the original message if the Control Block fails decoding (morethan 64 symbols are corrupted). Thus, if a Control Block fails decoding,it is possible to examine sets of 3 bytes in an effort to determine themost likely values for the 2 decoding parameters. It is not guaranteedto be recoverable, but it has a better chance through redundancy. Saythe last 159 bytes of the Control Block are destroyed, and the first 96bytes are perfectly ok. Looking at the first 96 bytes will show arepeating set of numbers. These numbers can be sensibly used to decodethe remainder of the message in the remaining 7,166 Reed-Solomon blocks.

[0984] By way of example, assume a data file containing exactly 9,967bytes of data. The number of Reed-Solomon blocks required is 79. Thefirst 78 Reed-Solomon blocks are completely utilized, consuming 9,906bytes (78×127). The 79th block has only 61 bytes of data (with theremaining 66 bytes all 0s).

[0985] The alternative Artcard would consist of 7,168 Reed-Solomonblocks. The first 2 blocks would be Control Blocks, the next 79 would bethe encoded data, the next 79 would be a duplicate of the encoded data,the next 79 would be another duplicate of the encoded data, and so on.After storing the 79 Reed-Solomon blocks 90 times, the remaining 56Reed-Solomon blocks would be another duplicate of the first 56 blocksfrom the 79 blocks of encoded data (the final 23 blocks of encoded datawould not be stored again as there is not enough room on the alternativeArtcard). A hex representation of the 127 bytes in each Control Blockdata before being Reed-Solomon encoded would be as illustrated in FIG.59.

[0986] Scramble the Encoded Data

[0987] Assuming all the encoded blocks have been stored contiguously inmemory, a maximum 1,827,840 bytes of data can be stored on thealternative Artcard (2 Control Blocks and 7,166 information blocks,totalling 7,168 Reed-Solomon encoded blocks). Preferably, the data isnot directly stored onto the alternative Artcard at this stage however,or all 255 bytes of one Reed-Solomon block will be physically togetheron the card. Any dirt, grime, or stain that causes physical damage tothe card has the potential of damaging more than 64 bytes in a singleReed-Solomon block, which would make that block unrecoverable. If thereare no duplicates of that Reed-Solomon block, then the entirealternative Artcard cannot be decoded.

[0988] The solution is to take advantage of the fact that there are alarge number of bytes on the alternative Artcard, and that thealternative Artcard has a reasonable physical size. The data cantherefore be scrambled to ensure that symbols from a single Reed-Solomonblock are not in close proximity to one another. Of course pathologicalcases of card degradation can cause Reed-Solomon blocks to beunrecoverable, but on average, the scrambling of data makes the cardmuch more robust. The scrambling scheme chosen is simple and isillustrated schematically in FIG. 14. All the Byte 0s from eachReed-Solomon block are placed together 1136, then all the Byte 1s etc.There will therefore be 7,168 byte 0's, then 7,168 Byte 1's etc. Eachdata block on the alternative Artcard can store 28,560 bytes.Consequently there are approximately 4 bytes from each Reed-Solomonblock in each of the 64 data blocks on the alternative Artcard.

[0989] Under this scrambling scheme, complete damage to 16 entire datablocks on the alternative Artcard will result in 64 symbol errors perReed-Solomon block. This means that if there is no other damage to thealternative Artcard, the entire data is completely recoverable, even ifthere is no data duplication.

[0990] Write the Scrambled Encoded Data to the Alternative Artcard

[0991] Once the original data has been Reed-Solomon encoded, duplicated,and scrambled, there are 1,827,840 bytes of data to be stored on thealternative Artcard. Each of the 64 data blocks on the alternativeArtcard stores 28,560 bytes.

[0992] The data is simply written out to the alternative Artcard datablocks so that the first data block contains the first 28,560 bytes ofthe scrambled data, the second data block contains the next 28,560 bytesetc.

[0993] As illustrated in FIG. 61, within a data block, the data iswritten out column-wise left to right. Thus the left-most column withina data block contains the first 48 bytes of the 28,560 bytes ofscrambled data, and the last column contains the last 48 bytes of the28,560 bytes of scrambled data. Within a column, bytes are written outtop to bottom, one bit at a time, starting from bit 7 and finishing withbit 0. If the bit is set (1), a black dot is placed on the alternativeArtcard, if the bit is clear (0), no dot is placed, leaving it the whitebackground color of the card.

[0994] For example, a set of 1,827,840 bytes of data can be created byscrambling 7,168 Reed-Solomon encoded blocks to be stored onto analternative Artcard. The first 28,560 bytes of data are written to thefirst data block. The first 48 bytes of the first 28,560 bytes arewritten to the first column of the data block, the next 48 bytes to thenext column and so on. Suppose the first two bytes of the 28,560 bytesare hex D3 5F. Those first two bytes will be stored in column 0 of thedata block. Bit 7 of byte 0 will be stored first, then bit 6 and so on.Then Bit 7 of byte 1 will be stored through to bit 0 of byte 1. Sinceeach “1” is stored as a black dot, and each “0” as a white dot, thesetwo bytes will be represented on the alternative Artcard as thefollowing set of dots:

[0995] D3 (1101 0011) becomes: black, black, white, black, white, white,black, black

[0996] 5F (0101 1111) becomes: white, black, white, black, black, black,black, black

[0997] Decoding an Alternative Artcard

[0998] This section deals with extracting the original data from analternative Artcard in an accurate and robust manner. Specifically, itassumes the alternative Artcard format as described in the previouschapter, and describes a method of extracting the original pre-encodeddata from the alternative Artcard.

[0999] There are a number of general considerations that are part of theassumptions for decoding an alternative Artcard.

[1000] User

[1001] The purpose of an alternative Artcard is to store data for use indifferent applications. A user inserts an alternative Artcard into analternative Artcard reader, and expects the data to be loaded in a“reasonable time”. From the user's perspective, a motor transport movesthe alternative Artcard into an alternative Artcard reader. This is notperceived as a problematic delay, since the alternative Artcard is inmotion. Any time after the alternative Artcard has stopped is perceivedas a delay, and should be minimized in any alternative Artcard readingscheme. Ideally, the entire alternative Artcard would be read while inmotion, and thus there would be no perceived delay after the card hadstopped moving.

[1002] For the purpose of the preferred embodiment, a reasonable timefor an alternative Artcard to be physically loaded is defined to be 1.5seconds. There should be a minimization of time for additional decodingafter the alternative Artcard has stopped moving. Since the Activeregion of an alternative Artcard covers most of the alternative Artcardsurface we can limit our timing concerns to that region.

[1003] Sampling Dots

[1004] The dots on an alternative Artcard must be sampled by a CCDreader or the like at least at double the printed resolution to satisfyNyquist's Theorem. In practice it is better to sample at a higher ratethan this. In the alternative Artcard reader environment, dots arepreferably sampled at 3 times their printed resolution in eachdimension, requiring 9 pixels to define a single dot. If the resolutionof the alternative Artcard dots is 1600 dpi, the alternative Artcardreader's image sensor must scan pixels at 4800 dpi. Of course if a dotis not exactly aligned with the sampling sensor, the worst and mostlikely case as illustrated in FIG. 62, is that a dot will be sensed overa 4×4 pixel area.

[1005] Each sampled pixel is 1 byte (8 bits). The lowest 2 bits of eachpixel can contain significant noise. Decoding algorithms must thereforebe noise tolerant.

[1006] Alignment/Rotation

[1007] It is extremely unlikely that a user will insert an alternativeArtcard into an alternative Artcard reader perfectly aligned with norotation. Certain physical constraints at a reader entrance and motortransport grips will help ensure that once inserted, an alternativeArtcard will stay at the original angle of insertion relative to theCCD. Preferably this angle of rotation, as illustrated in FIG. 63 is amaximum of 1 degree. There can be some slight aberrations in angle dueto jitter and motor rumble during the reading process, but these areassumed to essentially stay within the 1-degree limit.

[1008] The physical dimensions of an alternative Artcard are 86 mm×55mm. A 1 degree rotation adds 1.5 mm to the effective height of the cardas 86 mm passes under the CCD (86 sin 1°), which will affect therequired CCD length.

[1009] The effect of a 1 degree rotation on alternative Artcard readingis that a single scanline from the CCD will include a number ofdifferent columns of dots from the alternative Artcard. This isillustrated in an exaggerated form in FIG. 63 which shows the drift ofdots across the columns of pixels. Although exaggerated in this diagram,the actual drift will be a maximum 1 pixel column shift every 57 pixels.

[1010] When an alternative Artcard is not rotated, a single column ofdots can be read over 3 pixel scanlines. The more an alternative Artcardis rotated, the greater the local effect. The more dots being read, thelonger the rotation effect is applied. As either of these factorsincrease, the larger the number of pixel scanlines that are needed to beread to yield a given set of dots from a single column on an alternativeArtcard. The following table shows how many pixel scanlines are requiredfor a single column of dots in a particular alternative Artcardstructure. Region Height 0° rotation 1° rotation Active 3208 dots 3pixel columns 168 pixel columns region Data  394 dots 3 pixel columns 21 pixel columns block

[1011] To read an entire alternative Artcard, we need to read 87 mm (86mm+1 mm due to 1° rotation). At 4800 dpi this implies 16,252 pixelcolumns.

[1012] CCD (or Other Linear Image Sensor) Length

[1013] The length of the CCD itself must accommodate:

[1014] the physical height of the alternative Artcard (55 mm),

[1015] vertical slop on physical alternative Artcard insertion (1 mm)

[1016] insertion rotation of up to 1 degree (86 sin 1°=1.5 mm)

[1017] These factors combine to form a total length of 57.5 mm.

[1018] When the alternative Artcard Image sensor CCD in an alternativeArtcard reader scans at 4800 dpi, a single scanline is 10,866 pixels.For simplicity, this figure has been rounded up to 11,000 pixels. TheActive Region of an alternative Artcard has a height of 3208 dots, whichimplies 9,624 pixels. A Data Region has a height of 384 dots, whichimplies 1,152 pixels.

[1019] DRAM Size

[1020] The amount of memory required for alternative Artcard reading anddecoding is ideally minimized. The typical placement of an alternativeArtcard reader is an embedded system where memory resources areprecious. This is made more problematic by the effects of rotation. Asdescribed above, the more an alternative Artcard is rotated, the morescanlines are required to effectively recover original dots.

[1021] There is a trade-off between algorithmic complexity, userperceived delays, robustness, and memory usage. One of the simplestreader algorithms would be to simply scan the whole alternative Artcard,and then to process the whole data without real-time constraints. Notonly would this require huge reserves of memory, it would take longerthan a reader algorithm that occurred concurrently with the alternativeArtcard reading process.

[1022] The actual amount of memory required for reading and decoding analternative Artcard is twice the amount of space required to hold theencoded data, together with a small amount of scratch space (1-2 KB).For the 1600 dpi alternative Artcard, this implies a 4 MB memoryrequirement. The actual usage of the memory is detailed in the followingalgorithm description.

[1023] Transfer Rate

[1024] DRAM bandwidth assumptions need to be made for timingconsiderations and to a certain extent affect algorithmic design,especially since alternative Artcard readers are typically part of anembedded system.

[1025] A standard Rambus Direct RDRAM architecture is assumed, asdefined in Rambus Inc, October 1997, Direct Rambus TechnologyDisclosure, with a peak data transfer rate of 1.6 GB/sec. Assuming 75%efficiency (easily achieved), we have an average of 1.2 GB/sec datatransfer rate. The average time to access a block of 16 bytes istherefore 12 ns.

[1026] Dirty Data

[1027] Physically damaged alternative Artcards can be inserted into areader. Alternative Artcards may be scratched, or be stained with grimeor dirt. A alternative Artcard reader can't assume to read everythingperfectly. The effect of dirty data is made worse by blurring, as thedirty data affects the surrounding clean dots.

[1028] Blurry Environment

[1029] There are two ways that blurring is introduced into thealternative Artcard reading environment:

[1030] Natural blurring due to nature of the CCD's distance from thealternative Artcard.

[1031] Warping of alternative Artcard Natural blurring of an alternativeArtcard image occurs when there is overlap of sensed data from the CCD.Blurring can be useful, as the overlap ensures there are no highfrequencies in the sensed data, and that there is no data missed by theCCD. However if the area covered by a CCD pixel is too large, there willbe too much blurring and the sampling required to recover the data willnot be met. FIG. 64 is a schematic illustration of the overlapping ofsensed data.

[1032] Another form of blurring occurs when an alternative Artcard isslightly warped due to heat damage. When the warping is in the verticaldimension, the distance between the alternative Artcard and the CCD willnot be constant, and the level of blurring will vary across those areas.

[1033] Black and white dots were chosen for alternative Artcards to givethe best dynamic range in blurry reading environments. Blurring cancause problems in attempting to determine whether a given dot is blackor white.

[1034] As the blurring increases, the more a given dot is influenced bythe surrounding dots. Consequently the dynamic range for a particulardot decreases. Consider a white dot and a black dot, each surrounded byall possible sets of dots. The 9 dots are blurred, and the center dotsampled. FIG. 65 shows the distribution of resultant center dot valuesfor black and white dots.

[1035] The diagram is intended to be a representative blurring. Thecurve 1140 from 0 to around 180 shows the range of black dots. The curve1141 from 75 to 250 shows the range of white dots. However the greaterthe blurring, the more the two curves shift towards the center of therange and therefore the greater the intersection area, which means themore difficult it is to determine whether a given dot is black or white.A pixel value at the center point of intersection is ambiguous—the dotis equally likely to be a black or a white.

[1036] As the blurring increases, the likelihood of a read bit errorincreases. Fortunately, the Reed-Solomon decoding algorithm can copewith these gracefully up to t symbol errors. FIG. 65 is a graph ofnumber predicted number of alternative Artcard Reed-Solomon blocks thatcannot be recovered given a particular symbol error rate. Notice how theReed-Solomon decoding scheme performs well and then substantiallydegrades. If there is no Reed-Solomon block duplication, then only 1block needs to be in error for the data to be unrecoverable. Of course,with block duplication the chance of an alternative Artcard decodingincreases.

[1037]FIG. 66 only illustrates the symbol (byte) errors corresponding tothe number of Reed-Solomon blocks in error. There is a trade-off betweenthe amount of blurring that can be coped with, compared to the amount ofdamage that has been done to a card. Since all error detection andcorrection is performed by a Reed-Solomon decoder, there is a finitenumber of errors per Reed-Solomon data block that can be coped with. Themore errors introduced through blurring, the fewer the number of errorsthat can be coped with due to alternative Artcard damage.

[1038] Overview of Alternative Artcard Decoding

[1039] As noted previously, when the user inserts an alternative Artcardinto an alternative Artcard reading unit, a motor transport ideallycarries the alternative Artcard past a monochrome linear CCD imagesensor. The card is sampled in each dimension at three times the printedresolution. Alternative Artcard reading hardware and software compensatefor rotation up to 1 degree, jitter and vibration due to the motortransport, and blurring due to variations in alternative Artcard to CCDdistance. A digital bit image of the data is extracted from the sampledimage by a complex method described here. Reed-Solomon decoding correctsarbitrarily distributed data corruption of up to 25% of the raw data onthe alternative Artcard. Approximately 1 MB of corrected data isextracted from a 1600 dpi card.

[1040] The steps involved in decoding are so as indicated in FIG. 67.

[1041] The decoding process requires the following steps:

[1042] Scan 1144 the alternative Artcard at three times printedresolution (eg scan 1600 dpi alternative Artcard at 4800 dpi)

[1043] Extract 1145 the data bitmap from the scanned dots on the card.

[1044] Reverse 1146 the bitmap if the alternative Artcard was insertedbackwards.

[1045] Unscramble 1147 the encoded data

[1046] Reed-Solomon 1148 decode the data from the bitmap

[1047] Algorithmic Overview

[1048] Phase 1—Real Time Bit Image Extraction

[1049] A simple comparison between the available memory (4 MB) and thememory required to hold all the scanned pixels for a 1600 dpialternative Artcard (172.5 MB) shows that unless the card is readmultiple times (not a realistic option), the extraction of the bitmapfrom the pixel data must be done on the fly, in real time, while thealternative Artcard is moving past the CCD. Two tasks must beaccomplished in this phase:

[1050] Scan the alternative Artcard at 4800 dpi

[1051] Extract the data bitmap from the scanned dots on the card

[1052] The rotation and unscrambling of the bit image cannot occur untilthe whole bit image has been extracted. It is therefore necessary toassign a memory region to hold the extracted bit image. The bit imagefits easily within 2 MB, leaving 2 MB for use in the extraction process.

[1053] Rather than extracting the bit image while looking only at thecurrent scanline of pixels from the CCD, it is possible to allocate abuffer to act as a window onto the alternative Artcard, storing the lastN scanlines read. Memory requirements do not allow the entirealternative Artcard to be stored this way (172.5 MB would be required),but allocating 2 MB to store 190 pixel columns (each scanline takes lessthan 11,000 bytes) makes the bit image extraction process simpler.

[1054] The 4 MB memory is therefore used as follows:

[1055] 2 MB for the extracted bit image

[1056] ˜2 MB for the scanned pixels

[1057] 1.5 KB for Phase 1 scratch data (as required by algorithm)

[1058] The time taken for Phase 1 is 1.5 seconds, since this is the timetaken for the alternative Artcard to travel past the CCD and physicallyload.

[1059] Phase 2—Data Extraction from Bit Image

[1060] Once the bit image has been extracted, it must be unscrambled andpotentially rotated 180°. It must then be decoded. Phase 2 has noreal-time requirements, in that the alternative Artcard has stoppedmoving, and we are only concerned with the user's perception of elapsedtime. Phase 2 therefore involves the remaining tasks of decoding analternative Artcard:

[1061] Re-organize the bit image, reversing it if the alternativeArtcard was inserted backwards

[1062] Unscramble the encoded data

[1063] Reed-Solomon decode the data from the bit image

[1064] The input to Phase 2 is the 2 MB bit image buffer. Unscramblingand rotating cannot be performed in situ, so a second 2 MB buffer isrequired. The 2 MB buffer used to hold scanned pixels in Phase 1 is nolonger required and can be used to store the rotated unscrambled data.

[1065] The Reed-Solomon decoding task takes the unscrambled bit imageand decodes it to 910,082 bytes. The decoding can be performed in situ,or to a specified location elsewhere. The decoding process does notrequire any additional memory buffers.

[1066] The 4 MB memory is therefore used as follows:

[1067] 2 MB for the extracted bit image (from Phase 1)

[1068] ˜2 MB for the unscrambled, potentially rotated bit image

[1069] <1 KB for Phase 2 scratch data (as required by algorithm)

[1070] The time taken for Phase 2 is hardware dependent and is bound bythe time taken for Reed-Solomon decoding. Using a dedicated core such asLSI Logic's L64712, or an equivalent CPU/DSP combination, it isestimated that Phase 2 would take 0.32 seconds.

[1071] Phase 1—Extract Bit Image

[1072] This is the real-time phase of the algorithm, and is concernedwith extracting the bit image from the alternative Artcard as scanned bythe CCD.

[1073] As shown in FIG. 68 Phase 1 can be divided into 2 asynchronousprocess streams. The first of these streams is simply the real-timereader of alternative Artcard pixels from the CCD, writing the pixels toDRAM. The second stream involves looking at the pixels, and extractingthe bits. The second process stream is itself divided into 2 processes.The first process is a global process, concerned with locating the startof the alternative Artcard. The second process is the bit imageextraction proper.

[1074]FIG. 69 illustrates the data flow from a data/process perspective.

[1075] Timing

[1076] For an entire 1600 dpi alternative Artcard, it is necessary toread a maximum of 16,252 pixel-columns. Given a total time of 1.5seconds for the whole alternative Artcard, this implies a maximum timeof 92,296 ns per pixel column during the course of the variousprocesses.

[1077] Process 1—Read Pixels from CCD

[1078] The CCD scans the alternative Artcard at 4800 dpi, and generates11,000 1-byte pixel samples per column. This process simply takes thedata from the CCD and writes it to DRAM, completely independently of anyother process that is reading the pixel data from DRAM. FIG. 70illustrates the steps involved.

[1079] The pixels are written contiguously to a 2 MB buffer that canhold 190 full columns of pixels. The buffer always holds the 190 columnsmost recently read. Consequently, any process that wants to read thepixel data (such as Processes 2 and 3) must firstly know where to lookfor a given column, and secondly, be fast enough to ensure that the datarequired is actually in the buffer.

[1080] Process 1 makes the current scanline number (CurrentScanLine)available to other processes so they can ensure they are not attemptingto access pixels from scanlines that have not been read yet.

[1081] The time taken to write out a single column of data (11,000bytes) to DRAM is:

11,000/16*12=8,256 ns

[1082] Process 1 therefore uses just under 9% of the available DRAMbandwidth (8256/92296).

[1083] Process 2—Detect Start of Alternative Artcard

[1084] This process is concerned with locating the Active Area on ascanned alternative Artcard. The input to this stage is the pixel datafrom DRAM (placed there by Process 1). The output is a set of bounds forthe first 8 data blocks on the alternative Artcard, required as input toProcess 3. A high level overview of the process can be seen in FIG. 71.

[1085] An alternative Artcard can have vertical slop of 1 mm uponinsertion. With a rotation of 1 degree there is further vertical slop of1.5 mm (86 sin 1°). Consequently there is a total vertical slop of 2.5mm. At 1600 dpi, this equates to a slop of approximately 160 dots. Sincea single data block is only 394 dots high, the slop is just under half adata block. To get a better estimate of where the data blocks arelocated the alternative Artcard itself needs to be detected.

[1086] Process 2 therefore consists of two parts:

[1087] Locate the start of the alternative Artcard, and if found,

[1088] Calculate the bounds of the first 8 data blocks based on thestart of the alternative Artcard.

[1089] Locate the Start of the Alternative Artcard

[1090] The scanned pixels outside the alternative Artcard area are black(the surface can be black plastic or some other non-reflective surface).The border of the alternative Artcard area is white. If we process thepixel columns one by one, and filter the pixels to either black orwhite, the transition point from black to white will mark the start ofthe alternative Artcard. The highest level process is as follows: for(Column=0; Column < MAX_COLUMN; Column++) { Pixel = ProcessColumn(Column) if (Pixel) return (Pixel, Column) // success! } return failure// no alternative Artcard found

[1091] The ProcessColumn function is simple. Pixels from two areas ofthe scanned column are passed through a threshold filter to determine ifthey are black or white. It is possible to then wait for a certainnumber of white pixels and announce the start of the alternative Artcardonce the given number has been detected. The logic of processing a pixelcolumn is shown in the following pseudocode. 0 is returned if thealternative Artcard has not been detected during the column. Otherwisethe pixel number of the detected location is returned. // Try upperregion first count = 0 for (i=0; i<UPPER_REGION_BOUND; i++) { if(GetPixel (column, i) < THRESHOLD) { count = 0 // pixel is black } else{ count++ // pixel is white if (count > WHITE_ALTERNATIVE ARTCARD)return i } } // Try lower region next. Process pixels in reverse count =0 for (i=MAX_PIXEL_BOUND; i>LOWER_REGION_BOUND; i−−) { if (GetPixel(column, i) < THRESHOLD) { count = 0 // pixel is black } else { count++// pixel is white if (count > WHITE_ALTERNATIVE_ARTCARD) return i } }//Not in upper bound or in lower bound. Return failure return 0

[1092] Calculate Data Block Bounds

[1093] At this stage, the alternative Artcard has been detected.Depending on the rotation of the alternative Artcard, either the top ofthe alternative Artcard has been detected or the lower part of thealternative Artcard has been detected. The second step of Process 2determines which was detected and sets the data block bounds for Phase 3appropriately.

[1094] A look at Phase 3 reveals that it works on data block segmentbounds: each data block has a StartPixel and an EndPixel to determinewhere to look for targets in order to locate the data block's dataregion.

[1095] If the pixel value is in the upper half of the card, it ispossible to simply use that as the first StartPixel bounds. If the pixelvalue is in the lower half of the card, it is possible to move back sothat the pixel value is the last segment's EndPixel bounds. We stepforwards or backwards by the alternative Artcard data size, and thus setup each segment with appropriate bounds. We are now ready to beginextracting data from the alternative Artcard. // Adjust to become firstpixel if is lower pixel if (pixel > LOWER_REGION_BOUND) { pixel −= 6 *1152 if (pixel < 0) pixel = 0 } for (i=0; i<6; i++) { endPixel = pixel +1152 segment[i].MaxPixel = MAX_PIXEL_BOUND segment[i].SetBounds (pixel,endPixel) pixel = endPixel }

[1096] The MaxPixel value is defined in Process 3, and the SetBoundsfunction simply sets StartPixel and EndPixel clipping with respect to 0and MaxPixel.

[1097] Process 3—Extract Bit Data from Pixels

[1098] This is the heart of the alternative Artcard Reader algorithm.This process is concerned with extracting the bit data from the CCDpixel data. The process essentially creates a bit-image from the pixeldata, based on scratch information created by Process 2, and maintainedby Process 3. A high level overview of the process can be seen in FIG.72.

[1099] Rather than simply read an alternative Artcard's pixel column anddetermine what pixels belong to what data block, Process 3 works theother way around. It knows where to look for the pixels of a given datablock. It does this by dividing a logical alternative Artcard into 8segments, each containing 8 data blocks as shown in FIG. 73.

[1100] The segments as shown match the logical alternative Artcard.Physically, the alternative Artcard is likely to be rotated by someamount. The segments remain locked to the logical alternative Artcardstructure, and hence are rotation-independent. A given segment can haveone of two states:

[1101] LookingForTargets: where the exact data block position for thissegment has not yet been determined. Targets are being located byscanning pixel column data in the bounds indicated by the segmentbounds. Once the data block has been located via the targets, and boundsset for black & white, the state changes to ExtractingBitlmage.

[1102] ExtractingBitImage: where the data block has been accuratelylocated, and bit data is being extracted one dot column at a time andwritten to the alternative Artcard bit image. The following of datablock clockmarks gives accurate dot recovery regardless of rotation, andthus the segment bounds are ignored. Once the entire data block has beenextracted, new segment bounds are calculated for the next data blockbased on the current position. The state changes to LookingForTargets.

[1103] The process is complete when all 64 data blocks have beenextracted, 8 from each region.

[1104] Each data block consists of 595 columns of data, each with 48bytes. Preferably, the 2 orientation columns for the data block are eachextracted at 48 bytes each, giving a total of 28,656 bytes extracted perdata block. For simplicity, it is possible to divide the 2 MB of memoryinto 64×32 k chunks. The nth data block for a given segment is stored atthe location:

StartBuffer+(256 k*n)

[1105] Data Structure for Segments

[1106] Each of the 8 segments has an associated data structure. The datastructure defining each segment is stored in the scratch data area. Thestructure can be as set out in the following table: DataName Comment:CurrentState Defines the current state of the segment. Can be one of:LookingForTargets ExtractingBitImage Initial value is LookingForTargetsUsed during LookingForTargets: StartPixel Upper pixel bound of segment.Initially set by Process 2. EndPixel Lower pixel bound of segment.Initially set by Process 2 MaxPixel The maximum pixel number for anyscanline. It is set to the same value for each segment: 10,866.CurrentColumn Pixel column we're up to while looking for targets.FinalColumn Defines the last pixel column to look in for targets.LocatedTargets Points to a list of located Targets. PossibleTargetsPoints to a set of pointers to Target structures that representcurrently investigated pixel shapes that may be targets AvailableTargetsPoints to a set of pointers to Target structures that are currentlyunused. TargetsFound The number of Targets found so far in this datablock. PossibleTargetCount The number of elements in the PossibleTargetslist AvailabletargetCount The number of elements in the AvailableTargetslist Used during ExtractingBitImage: BitImage The start of the Bit Imagedata area in DRAM where to store the next data block: Segment 1 = X,Segment 2 = X + 32 k etc Advances by 256 k each time the state changesfrom ExtractingBitImageData to Looking ForTargets CurrentByte Offsetwithin BitImage where to store next extracted byte CurrentDotColumnHolds current clockmark/dot column number. Set to −8 when transitioningfrom state LookingForTarget to ExtractingBitImage. UpperClock Coordinate(column/pixel) of current upper clockmark/border LowerClock Coordinate(column/pixel) of current lower clockmark/border CurrentDot The centerof the current data dot for the current dot column. Initially set to thecenter of the first (topmost) dot of the data column. DataDelta What toadd (column/pixel) to CurrentDot to advance to the center of the nextdot. BlackMax Pixel value above which a dot is definitely white WhiteMinPixel value below which a dot is definitely black MidRange The pixelvalue that has equal likelihood of coming from black or white. When allsmarts have not determined the dot, this value is used to determine it.Pixels below this value are black, and above it are white.

[1107] High Level of Process 3

[1108] Process 3 simply iterates through each of the segments,performing a single line of processing depending on the segment'scurrent state. The pseudocode is straightforward: blockCount = 0 while(blockCount < 64) for (i=0; i<8; i++) { finishedBlock =segment[i].ProcessState( ) if (finishedBlock) blockCount++ }

[1109] Process 3 must be halted by an external controlling process if ithas not terminated after a specified amount of time. This will only bethe case if the data cannot be extracted. A simple mechanism is to starta countdown after Process 1 has finished reading the alternativeArtcard. If Process 3 has not finished by that time, the data from thealternative Artcard cannot be recovered.

[1110] CurrentState=LookingForTargets

[1111] Targets are detected by reading columns of pixels, onepixel-column at a time rather than by detecting dots within a given bandof pixels (between StartPixel and EndPixel) certain patterns of pixelsare detected. The pixel columns are processed one at a time until eitherall the targets are found, or until a specified number of columns havebeen processed. At that time the targets can be processed and the dataarea located via clockmarks. The state is changed to ExtractingBitImageto signify that the data is now to be extracted. If enough valid targetsare not located, then the data block is ignored, skipping to a columndefinitely within the missed data block, and then beginning again theprocess of looking for the targets in the next data block. This can beseen in the following pseudocode: finishedBlock = FALSE if(CurrentColumn < Process1.CurrentScanLine) { ProcessPixelColumn( )CurrentColumn++ } if ((TargetsFound = = 6) || (CurrentColumn >LastColumn)) { if (TargetsFound >= 2) ProcessTargets ( ) if(TargetsFound >= 2) { BuildClockmarkEstimates( ) SetBlackAndWhiteBounds() CurrentState = ExtractingBitImage Current DotColumn = −8 } else { //data block cannot be recovered. Look for // next instead. Must adjustpixel bounds to // take account of possible 1 degree rotation.finishedBlock = TRUE SetBounds (StartPixel−12, EndPixel+12) Bit Image +=256KB CurrentByte = 0 LastColumn += 1024 TargetsFound = 0 } } returnfinishedBlock

[1112] ProcessPixelColumn

[1113] Each pixel column is processed within the specified bounds(between StartPixel and EndPixel) to search for certain patterns ofpixels which will identify the targets. The structure of a single target(target number 2) is as previously shown in FIG. 54:

[1114] From a pixel point of view, a target can be identified by:

[1115] Left black region, which is a number of pixel columns consistingof large numbers of contiguous black pixels to build up the first partof the target.

[1116] Target center, which is a white region in the center of furtherblack columns

[1117] Second black region, which is the 2 black dot columns after thetarget center

[1118] Target number, which is a black-surrounded white region thatdefines the target number by its length

[1119] Third black region, which is the 2 black columns after the targetnumber

[1120] An overview of the required process is as shown in FIG. 74.

[1121] Since identification only relies on black or white pixels, thepixels 1150 from each column are passed through a filter 1151 to detectblack or white, and then run length encoded 1152. The run-lengths arethen passed to a state machine 1153 that has access to the last 3 runlengths and the 4th last color. Based on these values, possible targetspass through each of the identification stages.

[1122] The GatherMin&Max process 1155 simply keeps the minimum & maximumpixel values encountered during the processing of the segment. These areused once the targets have been located to set BlackMax, WhiteMin, andMidRange values.

[1123] Each segment keeps a set of target structures in its search fortargets. While the target structures themselves don't move around inmemory, several segment variables point to lists of pointers to thesetarget structures. The three pointer lists are repeated here:LocatedTargets Points to a set of Target structures that representlocated targets. PossibleTargets Points to a set of pointers to Targetstructures that represent currently investigated pixel shapes that maybe targets. AvailableTargets Points to a set of pointers to Targetstructures that are currently unused.

[1124] There are counters associated with each of these list pointers:TargetsFound, PossibleTargetCount, and AvailableTargetCountrespectively.

[1125] Before the alternative Artcard is loaded, TargetsFound andPossibleTargetCount are set to 0, and AvailableTargetCount is set to 28(the maximum number of target structures possible to have underinvestigation since the minimum size of a target border is 40 pixels,and the data area is approximately 1152 pixels). An example of thetarget pointer layout is as illustrated in FIG. 75.

[1126] As potential new targets are found, they are taken from theAvailableTargets list 1157, the target data structure is updated, andthe pointer to the structure is added to the PossibleTargets list 1158.When a target is completely verified, it is added to the LocatedTargetslist 1159. If a possible target is found not to be a target after all,it is placed back onto the AvailableTargets list 1157. Consequentlythere are always 28 target pointers in circulation at any time, movingbetween the lists.

[1127] The Target data structure 1160 can have the following form:DataName Comment CurrentState The current state of the target searchDetectCount Counts how long a target has been in a given stateStartPixel Where does the target start? All the lines of pixels in thistarget should start within a tolerance of this pixel value. TargetNumberWhich target number is this (according to what was read) Column Bestestimate of the target's center column ordinate Pixel Best estimate ofthe target's center pixel ordinate

[1128] The ProcessPixelColumn function within the find targets module1162 (FIG. 74) then, goes through all the run lengths one by one,comparing the runs against existing possible targets (via StartPixel),or creating new possible targets if a potential target is found wherenone was previously known. In all cases, the comparison is only made ifS0. color is white and S1.color is black.

[1129] The pseudocode for the ProcessPixelColumn set out hereinafter.When the first target is positively identified, the last column to bechecked for targets can be determined as being within a maximum distancefrom it. For 1° rotation, the maximum distance is 18 pixel columns.pixel = StartPixel t = 0 target=PossibleTarget[t] while ((pixel <EndPixel) && (Targets Found < 6)) { if ((S0.Color = = white) &&(S1.Color = = black)) { do { keepTrying = FALSE If ( (target != NULL) &&(target−>AddToTarget (Column, pixel, S1, S2, S3)) ) { if(target−>CurrentState = = IsATarget) { Remove target fromPossibleTargets List Add target to LocatedTargets List TargetsFound++ if(TargetsFound = = 1) FinalColumn = Column + MAX_TARGET_DELTA} } else if(target−>CurrentState = = NotATarget) { Remove target fromPossibleTargets List Add target to AvailableTargets List keepTrying =TRUE } else { t++ // advance to next target } target = PossibleTarget[t]} else { tmp = AvailableTargets[0] if(tmp−>AddToTarget(Column,pixel,S1,S2,S3) { Remove tmp fromAvailableTargets list Add tmp to PossibleTargets list t++ // target thas been shifted right } } } while (keepTrying) } pixel += S1.RunLengthAdvance S0/S1/S2/S3 }

[1130] AddToTarget is a function within the find targets module thatdetermines whether it is possible or not to add the specific run to thegiven target:

[1131] If the run is within the tolerance of target's starting position,the run is directly related to the current target, and can therefore beapplied to it.

[1132] If the run starts before the target, we assume that the existingtarget is still ok, but not relevant to the run. The target is thereforeleft unchanged, and a return value of FALSE tells the caller that therun was not applied. The caller can subsequently check the run to see ifit starts a whole new target of its own.

[1133] If the run starts after the target, we assume the target is nolonger a possible target. The state is changed to be NotATarget, and areturn value of TRUE is returned.

[1134] If the run is to be applied to the target, a specific action isperformed based on the current state and set of runs in S1, S2, and S3.The AddToTarget pseudocode is as follows: MAX_TARGET_DELTA = 1 if(CurrentState != NothingKnown) { if (pixel > StartPixel) // run startsafter target { diff = pixel − StartPixel if (diff > MAX_TARGET_DELTA) {CurrentState = NotATarget return TRUE } } else { diff = StartPixel −pixel if (diff > MAX_TARGET_DELTA) return FALSE } } runType =DetermineRunType (S1, S2, S3) EvaluateState (runType) StartPixel =currentPixel return TRUE

[1135] Types of pixel runs are identified in DetermineRunType is asfollows: Types of Pixel Runs Type How identified (S1 is always black)TargetBorder S1 = 40 < RunLength < 50 S2 = white run TargetCenter S1 =15 < RunLength < 26 S2 = white run with [RunLength < 12] S3 = black runwith [15 < RunLength < 26] TargetNumber S2 = white run with [RunLength<= 40]

[1136] The EvaluateState procedure takes action depending on the currentstate and the run type.

[1137] The actions are shown as follows in tabular form: Type of PixelCurrentState Run Action NothingKnown TargetBorder DetectCount = 1CurrentState = LeftOfCenter LeftOfCenter TargetBorder DetectCount++ if(DetectCount > 24) CurrentState = NotATarget TargetCenter DetectCount =1 CurrentState = InCenter Column = currentColumn Pixel = currentPixel +S1.RunLength CurrentState = NotATarget InCenter TargetCenterDetectCount++ tmp = currentPixel + S1.RunLength if (tmp < Pixel) Pixel =tmp if (DetectCount > 13) CurrentState = NotATarget TargetBorderDetectCount = 1 CurrentState = RightOfCenter CurrentState = NotATargetRightOfCenter TargetBorder DetectCount++ if (DetectCount >= 12)CurrentState = NotATarget TargetNumber DetectCount = 1 CurrentState =InTargetNumber TargetNumber = (S2.RunLength+ 2)/6 CurrentState =NotATarget InTargetNumber TargetNumber tmp = (S2.RunLength+ 2)/6 if(tmp > TargetNumber) TargetNumber = tmp DetectCount++ if (DetectCount >=12) CurrentState = NotATarget TargetBorder if (DetectCount >= 3)CurrentState = IsATarget else CurrentState = NotATarget CurrentState =NotATarget IsATarget or — — NotATarget

[1138] Processing Targets

[1139] he located targets (in the LocatedTargets list) are stored in theorder they were located. Depending on alternative Artcard rotation thesetargets will be in ascending pixel order or descending pixel order. Inaddition, the target numbers recovered from the targets may be in error.We may have also have recovered a false target. Before the clockmarkestimates can be obtained, the targets need to be processed to ensurethat invalid targets are discarded, and valid targets have targetnumbers fixed if in error (e.g. a damaged target number due to dirt).Two main steps are involved:

[1140] Sort targets into ascending pixel order

[1141] Locate and fix erroneous target numbers

[1142] The first step is simple. The nature of the target retrievalmeans that the data should already be sorted in either ascending pixelor descending pixel. A simple swap sort ensures that if the 6 targetsare already sorted correctly a maximum of 14 comparisons is made with noswaps. If the data is not sorted, 14 comparisons are made, with 3 swaps.The following pseudocode shows the sorting process: for (i = 0; i <TargetsFound−1; i++) { oldTarget = LocatedTargets[i] bestPixel =oldTarget−>Pixel best = i j = i+1 while (j<TargetsFound) { if(LocatedTargets[j]−> Pixel < bestPixel) best = j j++ } if (best != i) //move only if necessary LocatedTargets[i] = LocatedTargets [best]LocatedTargets[best] = oldTarget } }

[1143] Locating and fixing erroneous target numbers is only slightlymore complex. One by one, each of the N targets found is assumed to becorrect. The other targets are compared to this “correct” target and thenumber of targets that require change should target N be correct iscounted. If the number of changes is 0, then all the targets mustalready be correct. Otherwise the target that requires the fewestchanges to the others is used as the base for change. A change isregistered if a given target's target number and pixel position do notcorrelate when compared to the “correct” target's pixel position andtarget number. The change may mean updating a target's target number, orit may mean elimination of the target. It is possible to assume thatascending targets have pixels in ascending order (since they havealready been sorted). kPixelFactor = 1/(55 * 3) bestTarget = 0bestChanges = TargetsFound + 1 for (i=0; i< TotalTargetsFound; i++) {numberOfChanges = 0; fromPixel = (LocatedTargets[i])−>PixelfromTargetNumber = LocatedTargets[i].TargetNumber for (j=1; j<TotalTargetsFound; j++) { toPixel = LocatedTargets[j]−>Pixel deltaPixel= toPixel − fromPixel if (deltaPixel >= 0) deltaPixel +=PIXELS_BETWEEN_TARGET_CENTRES/2 else deltaPixel −=PIXELS_BETWEEN_TARGET_CENTRES/2 targetNumber =deltaPixel * kPixelFactortargetNumber += fromTargetNumber if ( (targetNumber <1)||(targetNumber > 6) || (targetNumber != LocatedTargets[j]−>TargetNumber) ) numberOfChanges ++ } if (numberOfChanges < bestChanges){ bestTarget = i bestChanges = numberOfChanges } if (bestChanges < 2)break; }

[1144] In most cases this function will terminate with bestChanges=0,which means no changes are required. Otherwise the changes need to beapplied. The functionality of applying the changes is identical tocounting the changes (in the pseudocode above) until the comparison withtargetNumber. The change application is: if ((targetNumber <1)||(targetNumber > TARGETS_PER_BLOCK)) { LocatedTargets[j] = NULLTargetsFound−− } else { LocatedTargets[j]−> TargetNumber = targetNumber}

[1145] At the end of the change loop, the LocatedTargets list needs tobe compacted and all NULL targets removed.

[1146] At the end of this procedure, there may be fewer targets.Whatever targets remain may now be used (at least 2 targets arerequired) to locate the clockmarks and the data region.

[1147] Building Clockmark Estimates from Targets

[1148] As shown previously in FIG. 55, the upper region's firstclockmark dot 1126 is 55 dots away from the center of the first target1124 (which is the same as the distance between target centers). Thecenter of the clockmark dots is a further 1 dot away, and the blackborder line 1123 is a further 4 dots away from the first clockmark dot.The lower region's first clockmark dot is exactly 7 targets-distanceaway (7×55 dots) from the upper region's first clockmark dot 1126.

[1149] It cannot be assumed that Targets 1 and 6 have been located, soit is necessary to use the upper-most and lower-most targets, and usethe target numbers to determine which targets are being used. It isnecessary at least 2 targets at this point. In addition, the targetcenters are only estimates of the actual target centers. It is to locatethe target center more accurately. The center of a target is white,surrounded by black. We therefore want to find the local maximum in bothpixel & column dimensions. This involves reconstructing the continuousimage since the maximum is unlikely to be aligned exactly on an integerboundary (our estimate).

[1150] Before the continuous image can be constructed around thetarget's center, it is necessary to create a better estimate of the 2target centers. The existing target centers actually are the top leftcoordinate of the bounding box of the target center. It is a simpleprocess to go through each of the pixels for the area defining thecenter of the target, and find the pixel with the highest value. Theremay be more than one pixel with the same maximum pixel value, but theestimate of the center value only requires one pixel.

[1151] The pseudocode is straightforward, and is performed for each ofthe 2 targets: CENTER_WIDTH = CENTER_HEIGHT = 12 maxPixel = 0x00 for(i=0; i<CENTER_WIDTH; i++) for (j=0; j<CENTER_HEIGHT; j++) { p =GetPixel(column+i, pixel+j) if (p > maxPixel) { maxPixel = pcenterColumn = column + i centerPixel = pixel + j } } Target.Column =centerColumn Target.Pixel = centerPixel

[1152] At the end of this process the target center coordinates point tothe whitest pixel of the target, which should be within one pixel of theactual center. The process of building a more accurate position for thetarget center involves reconstructing the continuous signal for 7scanline slices of the target, 3 to either side of the estimated targetcenter. The 7 maximum values found (one for each of these pixeldimension slices) are then used to reconstruct a continuous signal inthe column dimension and thus to locate the maximum value in thatdimension. // Given estimates column and pixel, determine a //betterColumn and betterPixel as the center of // the target for (y=0;y<7; y++) { for (x=0; x<7; x++) samples[x] = GetPixel(column−3+y,pixel−3+x) FindMax(samples, pos, maxVal) reSamples[y] = maxVal if (y = =3) betterPixel = pos + pixel } FindMax(reSamples, pos, maxVal)betterColumn = pos + column

[1153] FindMax is a function that reconstructs the original 1dimensional signal based sample points and returns the position of themaximum as well as the maximum value found. The method of signalreconstruction/resampling used is the Lanczos3 windowed sinc function asshown in FIG. 76.

[1154] The Lanczos3 windowed sinc function takes 7 (pixel) samples fromthe dimension being reconstructed, centered around the estimatedposition X, i.e. at X−3, X−2, X−1, X, X+1, X+2, X+3. We reconstructpoints from X−1 to X+1, each at an interval of 0.1, and determine whichpoint is the maximum. The position that is the maximum value becomes thenew center. Due to the nature of the kernel, only 6 entries are requiredin the convolution kernel for points between X and X+1. We use 6 pointsfor X−1 to X, and 6 points for X to X+1, requiring 7 points overall inorder to get pixel values from X−1 to X+1 since some of the pixelsrequired are the same.

[1155] Given accurate estimates for the upper-most target from andlower-most target to, it is possible to calculate the position of thefirst clockmark dot for the upper and lower regions as follows:TARGETS_PER_BLOCK = 6 numTargetsDiff = to.TargetNum − from.TargetNumdeltaPixel = (to.Pixel − from.Pixel) / numTargetsDiff deltaColumn = (to.Column − from.Column) / numTargetsDiff UpperClock.pixel = from.Pixel −(from.TargetNum*deltaPixel) UpperClock.column =from.Column−(from.TargetNum*deltaColumn) // Given the first dot of theupper clockmark, the // first dot of the lower clockmark isstraightforward. LowerClock.pixel = UpperClock.pixel + ((TARGETS_PER_BLOCK+1) * deltaPixel) LowerClock. column = UpperClock.column +((TARGETS_PER_ BLOCK+1) * deltaColumn)

[1156] This gets us to the first clockmark dot. It is necessary move thecolumn position a further 1 dot away from the data area to reach thecenter of the clockmark. It is necessary to also move the pixel positiona further 4 dots away to reach the center of the border line. Thepseudocode values for deltaColumn and deltaPixel are based on a 55 dotdistance (the distance between targets), so these deltas must be scaledby 1/55 and 4/55 respectively before being applied to the clockmarkcoordinates. This is represented as:

kDeltaDotFactor=1/DOTS_BETWEEN_TARGET_CENTRES

deltaColumn*=kDeltaDotFactor

deltapixel*=4*kDeltaDotFactor

UpperClock.pixel−=deltaPixel

UpperClock.column−=deltaColumn

LowerClock.pixel+=deltaPixel

LowerClock.column+=deltaColumn

[1157] UpperClock and LowerClock are now valid clockmark estimates forthe first clockmarks directly in line with the centers of the targets.

[1158] Setting Black and White Pixel/Dot Ranges

[1159] Before the data can be extracted from the data area, the pixelranges for black and white dots needs to be ascertained. The minimum andmaximum pixels encountered during the search for targets were stored inWhiteMin and BlackMax respectively, but these do not represent validvalues for these variables with respect to data extraction. They aremerely used for storage convenience. The following pseudocode shows themethod of obtaining good values for WhiteMin and BlackMax based on themin & max pixels encountered:

MinPixel=WhiteMin

MaxPixel=BlackMax

MidRange=(MinPixel+MaxPixel)/2

WhiteMin=MaxPixel−105

BlackMax=MinPixel+84

CurrentState =ExtractingBitImage

[1160] The ExtractingBitlmage state is one where the data block hasalready been accurately located via the targets, and bit data iscurrently being extracted one dot column at a time and written to thealternative Artcard bit image. The following of data blockclockmarks/borders gives accurate dot recovery regardless of rotation,and thus the segment bounds are ignored. Once the entire data block hasbeen extracted (597 columns of 48 bytes each; 595 columns of data+2orientation columns), new segment bounds are calculated for the nextdata block based on the current position. The state is changed toLookingForTargets.

[1161] Processing a given dot column involves two tasks:

[1162] The first task is to locate the specific dot column of data viathe clockmarks.

[1163] The second task is to run down the dot column gathering the bitvalues, one bit per dot.

[1164] These two tasks can only be undertaken if the data for the columnhas been read off the alternative Artcard and transferred to DRAM. Thiscan be determined by checking what scanline Process 1 is up to, andcomparing it to the clockmark columns. If the dot data is in DRAM we canupdate the clockmarks and then extract the data from the column beforeadvancing the clockmarks to the estimated value for the next dot column.The process overview is given in the following pseudocode, with specificfunctions explained hereinafter: finishedBlock = FALSEif((UpperClock.column < Process1.CurrentScanLine) && (LowerClock.column< Process1.CurrentScanLine)) { DetermineAccurateClockMarks( )DetermineDataInfo( ) if (CurrentDotColumn >= 0) ExtractDataFromColumn( )AdvanceClockMarks( ) if (CurrentDotColumn = = FINAL_COLUMN) {finishedBlock = TRUE currentState = LookingForTargetsSetBounds(UpperClock.pixel, LowerClock.pixel) BitImage += 256KBCurrentByte = 0 TargetsFound = 0 } } return finishedBlock

[1165] Locating the Dot Column

[1166] A given dot column needs to be located before the dots can beread and the data extracted. This is accomplished by following theclockmarks/borderline along the upper and lower boundaries of the datablock. A software equivalent of a phase-locked-loop is used to ensurethat even if the clockmarks have been damaged, good estimations ofclockmark positions will be made. FIG. 77 illustrates an example datablock's top left which corner reveals that there are clockmarks 3 dotshigh 1166 extending out to the target area, a white row, and then ablack border line.

[1167] Initially, an estimation of the center of the first blackclockmark position is provided (based on the target positions). We usethe black border 1168 to achieve an accurate vertical position (pixel),and the clockmark eg. 1166 to get an accurate horizontal position(column). These are reflected in the UpperClock and LowerClockpositions.

[1168] The clockmark estimate is taken and by looking at the pixel datain its vicinity, the continuous signal is reconstructed and the exactcenter is determined. Since we have broken out the two dimensions into aclockmark and border, this is a simple one-dimensional process thatneeds to be performed twice. However, this is only done every second dotcolumn, when there is a black clockmark to register against. For thewhite clockmarks we simply use the estimate and leave it at that.Alternatively, we could update the pixel coordinate based on the bordereach dot column (since it is always present). In practice it issufficient to update both ordinates every other column (with the blackclockmarks) since the resolution being worked at is so fine. The processtherefore becomes: // Turn the estimates of the clockmarks into accurate// positions only when there is a black clockmark // (ie every 2nd dotcolumn, starting from −8) if (Bit0(CurrentDotColumn) = = 0) // evencolumn { DetermineAccurateUpperDotCenter( )DetermineAccurateLowerDotCenter( ) }

[1169] If there is a deviation by more than a given tolerance(MAX_CLOCKMARK_DEVIATION), the found signal is ignored and onlydeviation from the estimate by the maximum tolerance is allowed. In thisrespect the functionality is similar to that of a phase-locked loop.Thus DetermineAccurateUpperDotCenter is implemented via the followingpseudocode: // use the estimated pixel position of // the border todetermine where to look for // a more accurate clockmark center. Theclockmark // is 3 dots high so even if the estimated position // of theborder is wrong, it won't affect the // fixing of the clockmarkposition. MAX_CLOCKMARK_DEVIATION = 0.5 diff =GetAccurateColumn(UpperClock.column,UpperClock.pixel+(3*PIXELS_PER_DOT)) diff −= UpperClock.column if(diff > MAX_CLOCKMARK_DEVIATION) diff = MAX_CLOCKMARK_DEVIATION else if(diff < −MAX_CLOCKMARK_DEVIATION) diff = −MAX_CLOCKMARK_DEVIATIONUpperClock.column += diff // Use the newly obtained clockmark center to// determine a more accurate border position. diff =GetAccuratePixel(UpperClock.column, UpperClock.pixel) diff −=UpperClock.pixel if (diff > MAX_CLOCKMARK_DEVIATION) diff =MAX_CLOCKMARK_DEVIATION else if (diff < −MAX_CLOCKMARK_DEVIATION) diff =−MAX_CLOCKMARK_DEVIATION UpperClock.pixel += diff

[1170] DetermineAccurateLowerDotCenter is the same, except that thedirection from the border to the clockmark is in the negative direction(−3 dots rather than +3 dots).

[1171] GetAccuratePixel and GetAccurateColumn are functions thatdetermine an accurate dot center given a coordinate, but only from theperspective of a single dimension. Determining accurate dot centers is aprocess of signal reconstruction and then finding the location where theminimum signal value is found (this is different to locating a targetcenter, which is locating the maximum value of the signal since thetarget center is white, not black). The method chosen for signalreconstruction/resampling for this application is the Lanczos3 windowedsinc function as previously discussed with reference to FIG. 76.

[1172] It may be that the clockmark or border has been damaged in someway—perhaps it has been scratched. If the new center value retrieved bythe resampling differs from the estimate by more than a toleranceamount, the center value is only moved by the maximum tolerance. If itis an invalid position, it should be close enough to use for dataretrieval, and future clockmarks will resynchronize the position.

[1173] Determining the Center of the First Data Dot and the Deltas toSubsequent Dots

[1174] Once an accurate UpperClock and LowerClock position has beendetermined, it is possible to calculate the center of the first data dot(CurrentDot), and the delta amounts to be added to that center positionin order to advance to subsequent dots in the column (DataDelta).

[1175] The first thing to do is calculate the deltas for the dot column.This is achieved simply by subtracting the UpperClock from theLowerClock, and then dividing by the number of dots between the twopoints. It is possible to actually multiply by the inverse of the numberof dots since it is constant for an alternative Artcard, and multiplyingis faster. It is possible to use different constants for obtaining thedeltas in pixel and column dimensions. The delta in pixels is thedistance between the two borders, while the delta in columns is betweenthe centers of the two clockmarks. Thus the function DetermineDataInfois two parts. The first is given by the pseudocode:

kDeltaColumnFactor=1/(DOTS_PER_DATA_COLUMN+2+2−1)

kDeltaPixelFactor=1/(DOTS_PER_DATA_COLUMN+5+5−1)

delta=LowerClock.column−UpperClock.column

DataDelta.column=delta*kDeltaColumnFactor

delta=LowerClock.pixel−UpperClock.pixel

DataDelta.pixel=delta*kDeltaPixelFactor

[1176] It is now possible to determine the center of the first data dotof the column. There is a distance of 2 dots from the center of theclockmark to the center of the first data dot, and 5 dots from thecenter of the border to the center of the first data dot. Thus thesecond part of the function is given by the pseudocode:

CurrentDot.column=UpperClock.column+(2*DataDelta.column)

CurrentDot.pixel=UpperClock.pixel+(5*DataDelta.pixel)

[1177] Running Down a Dot Column

[1178] Since the dot column has been located from the phase-locked looptracking the clockmarks, all that remains is to sample the dot column atthe center of each dot down that column. The variable CurrentDot pointsis determined to the center of the first dot of the current column. Wecan get to the next dot of the column by simply adding DataDelta (2additions: 1 for the column ordinate, the other for the pixel ordinate).A sample of the dot at the given coordinate (bi-linear interpolation) istaken, and a pixel value representing the center of the dot isdetermined. The pixel value is then used to determine the bit value forthat dot. However it is possible to use the pixel value in context withthe center value for the two surrounding dots on the same dot line tomake a better bit judgement.

[1179] We can be assured that all the pixels for the dots in the dotcolumn being extracted are currently loaded in DRAM, for if the two endsof the line (clockmarks) are in DRAM, then the dots between those twoclockmarks must also be in DRAM. Additionally, the data block height isshort enough (only 384 dots high) to ensure that simple deltas areenough to traverse the length of the line. One of the reasons the cardis divided into 8 data blocks high is that we cannot make the same rigidguarantee across the entire height of the card that we can about asingle data block.

[1180] The high level process of extracting a single line of data (48bytes) can be seen in the following pseudocode. The dataBuffer pointerincrements as each byte is stored, ensuring that consecutive bytes andcolumns of data are stored consecutively. bitCount = 8 curr = 0x00 //definitely black next = GetPixel(CurrentDot) for (i=0; i <DOTS_PER_DATA_COLUMN; i++) { CurrentDot += DataDelta prev = curr curr =next next = GetPixel(CurrentDot) bit = DetermineCenterDot(prev, curr,next) byte = (byte << 1) | bit bitCount−− if (bitCount = = 0) {*(BitImage | CurrentByte) = byte CurrentByte++ bitCount = 8 } }

[1181] The GetPixel function takes a dot coordinate (fixed point) andsamples 4 CCD pixels to arrive at a center pixel value via bilinearinterpolation.

[1182] The DetermineCenterDot function takes the pixel valuesrepresenting the dot centers to either side of the dot whose bit valueis being determined, and attempts to intelligently guess the value ofthat center dot's bit value. From the generalized blurring curve of FIG.64 there are three common cases to consider:

[1183] The dot's center pixel value is lower than WhiteMin, and istherefore definitely a black dot. The bit value is therefore definitely1.

[1184] The dot's center pixel value is higher than BlackMax, and istherefore definitely a white dot. The bit value is therefore definitely0.

[1185] The dot's center pixel value is somewhere between BlackMax andWhiteMin. The dot may be black, and it may be white. The value for thebit is therefore in question. A number of schemes can be devised to makea reasonable guess as to the value of the bit. These schemes mustbalance complexity against accuracy, and also take into account the factthat in some cases, there is no guaranteed solution. In those caseswhere we make a wrong bit decision, the bit's Reed-Solomon symbol willbe in error, and must be corrected by the Reed-Solomon decoding stage inPhase 2.

[1186] The scheme used to determine a dot's value if the pixel value isbetween BlackMax and WhiteMin is not too complex, but gives goodresults. It uses the pixel values of the dot centers to the left andright of the dot in question, using their values to help determine amore likely value for the center dot:

[1187] If the two dots to either side are on the white side of MidRange(an average dot value), then we can guess that if the center dot werewhite, it would likely be a “definite” white. The fact that it is in thenot-sure region would indicate that the dot was black, and had beenaffected by the surrounding white dots to make the value less sure. Thedot value is therefore assumed to be black, and hence the bit value is1.

[1188] If the two dots to either side are on the black side of MidRange,then we can guess that if the center dot were black, it would likely bea “definite” black. The fact that it is in the not-sure region wouldindicate that the dot was white, and had been affected by thesurrounding black dots to make the value less sure. The dot value istherefore assumed to be white, and hence the bit value is 0.

[1189] If one dot is on the black side of MidRange, and the other dot ison the white side of MidRange, we simply use the center dot value todecide. If the center dot is on the black side of MidRange, we chooseblack (bit value 1). Otherwise we choose white (bit value 0).

[1190] The logic is represented by the following: if (pixel < WhiteMin)// definitely black bit = 0x01 else if (pixel > BlackMax) // definitelywhite bit = 0x00 else if ((prev > MidRange) && (next> MidRange)) //probblack bit = 0x01 else if ((prev < MidRange) && (next < MidRange)) //probwhite bit = 0x00 else if (pixel < MidRange) bit = 0x01 else bit = 0x00

[1191] From this one can see that using surrounding pixel values cangive a good indication of the value of the center dot's state. Thescheme described here only uses the dots from the same row, but using asingle dot line history (the previous dot line) would also bestraightforward as would be alternative arrangements.

[1192] Updating Clockmarks for the Next Column

[1193] Once the center of the first data dot for the column has beendetermined, the clockmark values are no longer needed. They areconveniently updated in readiness for the next column after the data hasbeen retrieved for the column. Since the clockmark direction isperpendicular to the traversal of dots down the dot column, it ispossible to use the pixel delta to update the column, and subtract thecolumn delta to update the pixel for both clocks:

UpperClock.column+=DataDelta.pixel

LowerClock.column+=DataDelta.pixel

UpperClock.pixel−=DataDelta.column

LowerClock.pixel−=DataDelta.column

[1194] These are now the estimates for the next dot column.

[1195] Timing

[1196] The timing requirement will be met as long as DRAM utilizationdoes not exceed 100%, and the addition of parallel algorithm timingmultiplied by the algorithm DRAM utilization does not exceed 100%. DRAMutilization is specified relative to Process1, which writes each pixelonce in a consecutive manner, consuming 9% of the DRAM bandwidth.

[1197] The timing as described in this section, shows that the DRAM iseasily able to cope with the demands of the alternative Artcard Readeralgorithm. The timing bottleneck will therefore be the implementation ofthe algorithm in terms of logic speed, not DRAM access. The algorithmshave been designed however, with simple architectures in mind, requiringa minimum number of logical operations for every memory cycle. From thispoint of view, as long as the implementation state machine or equivalentCPU/DSP architecture is able to perform as described in the followingsub-sections, the target speed will be met.

[1198] Locating the Targets

[1199] Targets are located by reading pixels within the bounds of apixel column. Each pixel is read once at most. Assuming a run-lengthencoder that operates fast enough, the bounds on the location of targetsis memory access. The accesses will therefore be no worse than thetiming for Process 1, which means a 9% utilization of the DRAMbandwidth.

[1200] The total utilization of DRAM during target location (includingProcess1) is therefore 18%, meaning that the target locator will alwaysbe catching up to the alternative Artcard image sensor pixel reader.

[1201] Processing the Targets

[1202] The timing for sorting and checking the target numbers istrivial. The finding of better estimates for each of the two targetcenters involves 12 sets of 12 pixel reads, taking a total of 144 reads.However the fixing of accurate target centers is not trivial, requiring2 sets of evaluations. Adjusting each target center requires 8 sets of20 different 6-entry convolution kernels. Thus this totals 8×20×6multiply-accumulates=960. In addition, there are 7 sets of 7 pixels tobe retrieved, requiring 49 memory accesses. The total number per targetis therefore 144+960+49=1153, which is approximately the same number ofpixels in a column of pixels (1152). Thus each target evaluationconsumes the time taken by otherwise processing a row of pixels. For twotargets we effectively consume the time for 2 columns of pixels.

[1203] A target is positively identified on the first pixel column afterthe target number. Since there are 2 dot columns before the orientationcolumn, there are 6 pixel columns. The Target Location processeffectively uses up the first of the pixel columns, but the remaining 5pixel columns are not processed at all. Therefore the data area can belocated in ⅖ of the time available without impinging on any otherprocess time.

[1204] The remaining ⅗ of the time available is ample for the trivialtask of assigning the ranges for black and white pixels, a task that maytake a couple of machine cycles at most.

[1205] Extracting Data

[1206] There are two parts to consider in terms of timing:

[1207] Getting accurate clockmarks and border values

[1208] Extracting dot values

[1209] Clockmarks and border values are only gathered every second dotcolumn. However each time a clockmark estimate is updated to become moreaccurate, 20 different 6-entry convolution kernels must be evaluated. Onaverage there are 2 of these per dot column (there are 4 every 2dot-columns). Updating the pixel ordinate based on the border onlyrequires 7 pixels from the same pixel scanline. Updating the columnordinate however, requires 7 pixels from different columns, hencedifferent scanlines. Assuming worst case scenario of a cache miss foreach scanline entry and 2 cache misses for the pixels in the samescanline, this totals 8 cache misses.

[1210] Extracting the dot information involves only 4 pixel reads perdot (rather than the average 9 that define the dot). Considering thedata area of 1152 pixels (384 dots), at best this will save 72 cachereads by only reading 4 pixel dots instead of 9. The worst case is arotation of 1° which is a single pixel translation every 57 pixels,which gives only slightly worse savings.

[1211] It can then be safely said that, at worst, we will be readingfewer cache lines less than that consumed by the pixels in the dataarea. The accesses will therefore be no worse than the timing forProcess 1, which implies a 9% utilization of the DRAM bandwidth.

[1212] The total utilization of DRAM during data extraction (includingProcess1) is therefore 18%, meaning that the data extractor will alwaysbe catching up to the alternative Artcard image sensor pixel reader.This has implications for the Process Targets process in that theprocessing of targets can be performed by a relatively inefficientmethod if necessary, yet still catch up quickly during the extractingdata process.

[1213] Phase 2—Decode Bit Image

[1214] Phase 2 is the non-real-time phase of alternative Artcard datarecovery algorithm. At the start of Phase 2 a bit image has beenextracted from the alternative Artcard. It represents the bits read fromthe data regions of the alternative Artcard. Some of the bits will be inerror, and perhaps the entire data is rotated 180° because thealternative Artcard was rotated when inserted. Phase 2 is concerned withreliably extracting the original data from this encoded bit image. Thereare basically 3 steps to be carried out as illustrated in FIG. 79:

[1215] Reorganize the bit image, reversing it if the alternative Artcardwas inserted backwards

[1216] Unscramble the encoded data

[1217] Reed-Solomon decode the data from the bit image

[1218] Each of the 3 steps is defined as a separate process, andperformed consecutively, since the output of one is required as theinput to the next. It is straightforward to combine the first two stepsinto a single process, but for the purposes of clarity, they are treatedseparately here.

[1219] From a data/process perspective, Phase 2 has the structure asillustrated in FIG. 80.

[1220] The timing of Processes 1 and 2 are likely to be negligible,consuming less than {fraction (1/1000)}^(th) of a second between them.Process 3 (Reed Solomon decode) consumes approximately 0.32 seconds,making this the total time required for Phase 2.

[1221] Reorganize the bit image, reversing it if necessary The bit mapin DRAM now represents the retrieved data from the alternative Artcard.However the bit image is not contiguous. It is broken into 64 32 kchunks, one chunk for each data block. Each 32 k chunk contains only28,656 useful bytes:

[1222] 48 bytes from the leftmost Orientation Column

[1223] 28560 bytes from the data region proper

[1224] 48 bytes from the rightmost Orientation Column

[1225] 4112 unused bytes The 2 MB buffer used for pixel data (stored byProcess 1 of Phase 1) can be used to hold the reorganized bit image,since pixel data is not required during Phase 2. At the end of thereorganization, a correctly oriented contiguous bit image will be in the2 MB pixel buffer, ready for Reed-Solomon decoding.

[1226] If the card is correctly oriented, the leftmost OrientationColumn will be white and the rightmost Orientation Column will be black.If the card has been rotated 180°, then the leftmost Orientation Columnwill be black and the rightmost Orientation Column will be white.

[1227] A simple method of determining whether the card is correctlyoriented or not, is to go through each data block, checking the firstand last 48 bytes of data until a block is found with an overwhelmingratio of black to white bits. The following pseudocode demonstratesthis, returning TRUE if the card is correctly oriented, and FALSE if itis not: totalCountL = 0 totalCountR = 0 for (i=0; i<64; i++) {blackCountL = 0 blackCountR = 0 currBuff = dataBuffer for (j=0; j<48;j++) { blackCountL += CountBits(*currBuff) currBuff++ } currBuff +=28560 for (j=0; j<48; j++) { blackCountR += CountBits(*currBuff)currBuff ++ } dataBuffer += 32k if (blackCountR > (blackCountL * 4))   return TRUE if (blackCountL > (blackCountR * 4))    return FALSEtotalCountL += blackCountL totalCountR += blackCountR } return(totalCountR > totalCountL)

[1228] The data must now be reorganized, based on whether the card wasoriented correctly or not. The simplest case is that the card iscorrectly oriented. In this case the data only needs to be moved arounda little to remove the orientation columns and to make the entire datacontiguous. This is achieved very simply in situ, as described by thefollowing pseudocode: DATA_BYTES_PER_DATA_BLOCK = 28560 to = dataBufferfrom = dataBuffer + 48) // left orientation column for (i=0; i<64; i++){ BlockMove(from, to, DATA_BYTES_PER_DATA_BLOCK) from += 32k to +=DATA_BYTES_PER_DATA_BLOCK }

[1229] The other case is that the data actually needs to be reversed.The algorithm to reverse the data is quite simple, but for simplicity,requires a 256-byte table Reverse where the value of Reverse[N] is abit-reversed N. DATA_BYTES_PER_DATA BLOCK = 28560 to = outBuffer for(i=0; i<64; i++) { from = dataBuffer + (i * 32k) from += 48 // skiporientation column from += DATA_BYTES_PER_DATA_BLOCK − 1 // end of blockfor (j=0; j < DATA_BYTES_PER_DATA_BLOCK; j++) { *to++ = Reverse [*from]from−− } } The timing for either process is negligible, consuming lessthan 1/1000^(th) of a second: * 2MB contiguous reads (2048/16 × 12ns =1,536ns) * 2MB effectively contiguous byte writes (2048/16 × 12ns =1,536ns)

[1230] Unscramble the Encoded Image

[1231] The bit image is now 1,827,840 contiguous, correctly oriented,but scrambled bytes. The bytes must be unscrambled to create the 7,168Reed-Solomon blocks, each 255 bytes long. The unscrambling process isquite straightforward, but requires a separate output buffer since theunscrambling cannot be performed in situ. FIG. 80 illustrates theunscrambling process conducted memory

[1232] The following pseudocode defines how to perform the unscramblingprocess: groupSize = 255 numBytes = 1827840; inBuffer = scrambledBuffer;outBuffer = unscrambledBuffer; for (i=0; i<groupSize; i++) for (j=i;j<numBytes; j+=groupSize) outBuffer[j] = *inBuffer++

[1233] The timing for this process is negligible, consuming less than{fraction (1/1000)}^(th) of a second:

[1234] 2 MB contiguous reads (2048/16×12 ns=1,536 ns)

[1235] 2 MB non-contiguous byte writes (2048×12 ns=24,576 ns)

[1236] At the end of this process the unscrambled data is ready forReed-Solomon decoding.

[1237] Reed Solomon Decode

[1238] The final part of reading an alternative Artcard is theReed-Solomon decode process, where approximately 2 MB of unscrambleddata is decoded into approximately 1 MB of valid alternative Artcarddata.

[1239] The algorithm performs the decoding one Reed-Solomon block at atime, and can (if desired) be performed in situ, since the encoded blockis larger than the decoded block, and the redundancy bytes are storedafter the data bytes.

[1240] The first 2 Reed-Solomon blocks are control blocks, containinginformation about the size of the data to be extracted from the bitimage. This meta-information must be decoded first, and the resultantinformation used to decode the data proper. The decoding of the dataproper is simply a case of decoding the data blocks one at a time.Duplicate data blocks can be used if a particular block fails to decode.

[1241] The highest level of the Reed-Solomon decode is set out inpseudocode: // Constants for Reed Solomon decode sourceBlockLength =255; destBlockLength = 127; numControlBlocks = 2; // Decode the controlinformation if (! GetControlData(source, destBlocks, lastBlock)) returnerror destBytes = ((destBlocks−1) * destBlockLength) + lastBlockoffsetToNextDuplicate = destBlocks * sourceBlockLength // Skip thecontrol blocks and position at data source += numControlBlocks *sourceBlockLength // Decode each of the data blocks, trying //duplicates as necessary blocksInError = 0; for (i=0; i<destBlocks; i++){ found = DecodeBlock(source, dest); if (! found) { duplicate = source +offsetToNextDuplicate while ((! found) && (duplicate<sourceEnd)) { found= DecodeBlock(duplicate, dest) duplicate += offsetToNextDuplicate } } if(! found) blocksInError++ source += sourceBlockLength dest +=destBlockLength } return destBytes and blocksInError

[1242] DecodeBlock is a standard Reed Solomon block decoder using m=8and t=64.

[1243] The GetControlData function is straightforward as long as thereare no decoding errors. The function simply calls DecodeBlock to decodeone control block at a time until successful. The control parameters canthen be extracted from the first 3 bytes of the decoded data (destBlocksis stored in the bytes 0 and 1, and lastBlock is stored in byte 2). Ifthere are decoding errors the function must traverse the 32 sets of 3bytes and decide which is the most likely set value to be correct. Onesimple method is to find 2 consecutive equal copies of the 3 bytes, andto declare those values the correct ones. An alternative method is tocount occurrences of the different sets of 3 bytes, and announce themost common occurrence to be the correct one.

[1244] The time taken to Reed-Solomon decode depends on theimplementation. While it is possible to use a dedicated core to performthe Reed-Solomon decoding process (such as LSI Logic's L64712), it ispreferable to select a CPU/DSP combination that can be more generallyused throughout the embedded system (usually to do something with thedecoded data) depending on the application. Of course decoding time mustbe fast enough with the CPU/DSP combination.

[1245] The L64712 has a throughput of 50 Mbits per second (around 6.25MB per second), so the time is bound by the speed of the Reed-Solomondecoder rather than the maximum 2 MB read and 1 MB write memory accesstime. The time taken in the worst case (all 2 MB requires decoding) isthus 2/6.25 s=approximately 0.32 seconds. Of course, many furtherrefinements are possible including the following:

[1246] The blurrier the reading environment, the more a given dot isinfluenced by the surrounding dots. The current reading algorithm of thepreferred embodiment has the ability to use the surrounding dots in thesame column in order to make a better decision about a dot's value.Since the previous column's dots have already been decoded, a previouscolumn dot history could be useful in determining the value of thosedots whose pixel values are in the not-sure range.

[1247] A different possibility with regard to the initial stage is toremove it entirely, make the initial bounds of the data blocks largerthan necessary and place greater intelligence into the ProcessingTargetsfunctions. This may reduce overall complexity. Care must be taken tomaintain data block independence.

[1248] Further the control block mechanism can be made more robust:

[1249] The control block could be the first and last blocks rather thanmake them contiguous (as is the case now). This may give greaterprotection against certain pathological damage scenarios.

[1250] The second refinement is to place an additional level ofredundancy/error detection into the control block structure to be usedif the Reed-Solomon decode step fails. Something as simple as paritymight improve the likelihood of control information if the Reed-Solomonstage fails.

[1251] Phase 5 Running the Vark script

[1252] The overall time taken to read the Artcard 9 and decode it istherefore approximately 2.15 seconds. The apparent delay to the user isactually only 0.65 seconds (the total of Phases 3 and 4), since theArtcard stops moving after 1.5 seconds.

[1253] Once the Artcard is loaded, the Artvark script must beinterpreted, Rather than run the script immediately, the script is onlyrun upon the pressing of the ‘Print’ button 13 (FIG. 1). The taken torun the script will vary depending on the complexity of the script, andmust be taken into account for the perceived delay between pressing theprint button and the actual print button and the actual printing.

[1254] As noted previously, the VLIW processor 74 is a digitalprocessing system that accelerates computationally expensive Varkfunctions. The balance of functions performed in software by the CPUcore 72, and in hardware by the VLIW processor 74 will be implementationdependent. The goal of the VLIW processor 74 is to assist all Artcardstyles to execute in a time that does not seem too slow to the user. AsCPUs become faster and more powerful, the number of functions requiringhardware acceleration becomes less and less. The VLIW processor has amicrocoded ALU sub-system that allows general hardware speed up of thefollowing time-critical functions.

[1255] 1) Image access mechanisms for general software processing

[1256] 2) Image convolver.

[1257] 3) Data driven image warper

[1258] 4) Image scaling

[1259] 5) Image tessellation

[1260] 6) Affine transform

[1261] 7) Image compositor

[1262] 8) Color space transform

[1263] 9) Histogram collector

[1264] 10) Illumination of the Image

[1265] 11) Brush stamper

[1266] 12) Histogram collector

[1267] 13) CCD image to internal image conversion

[1268] 14) Construction of image pyramids (used by warper & forbrushing)

[1269] The following table summarizes the time taken for each Varkoperation if implemented in the ALU model. The method of implementingthe function using the ALU model is described hereinafter. Speed of1500 * 1000 image Operation Operation 1 channel 3 channels Imagecomposite 1 cycle per 0.015 s 0.045 s output pixel Image convolve{fraction (k/3)} cycles per output pixel (k = kernel size) 3x3 convolve0.045 s 0.135 s 5x5 convolve 0.125 s 0.375 s 7x7 convolve 0.245 s 0.735s Image warp 8 cycles per 0.120 s 0.360 s pixel Histogram collect 2cycles per 0.030 s 0.090 s pixel Image Tessellate ⅓ cycle per 0.005 s0.015 s pixel Image sub-pixel 1 cycle per — — Translate output pixelColor lookup ½ cycle per pixel 0.008 s 0.023 replace Color space 8cycles per 0.120 s 0.360 s transform pixel Convert CCD image 4 cyclesper 0.06 s 0.18 s to internal image output pixel (including colorconvert & scale) Construct image 1 cycle per 0.015 s 0.045 s pyramidinput pixel Scale Maximum of: 0.015 s 0.045 s 2 cycles per (minimum)(minimum) input pixel 2 cycles per output pixel 2 cycles per outputpixel (scaled in X only) Affine transform 2 cycles per 0.03 s 0.09 soutput pixel Brush ? rotate/translate and composite Tile Image 4-8cycles 0.015 s to 0.060 s to per output 0.030 s 0.120 s to for pixel 4channels (Lab, texture) Illuminate image Cycles per pixel Ambient only ½0.008 s 0.023 s Directional 1 0.015 s 0.045 s light 6 0.09 s 0.27 sDirectional 6 0.09 s 0.27 s (bm) 9 0.137 s 0.41 s Omni light 9 0.137 s0.41 s Omni (bm) 12  0.18 s 0.54 s Spotlight Spotlight (bm) (bm) =bumpmap

[1270] For example, to convert a CCD image, collect histogram & performlookup-color replacement (for image enhancement) takes: 9+2+0.5 cyclesper pixel, or 11.5 cycles. For a 1500×1000 image that is 172,500,000, orapproximately 0.2 seconds per component, or 0.6 seconds for all 3components. Add a simple warp, and the total comes to 0.6+0.36, almost 1second.

[1271] Image Convolver

[1272] A convolve is a weighted average around a center pixel. Theaverage may be a simple sum, a sum of absolute values, the absolutevalue of a sum, or sums truncated at 0.

[1273] The image convolver is a general-purpose convolver, allowing avariety of functions to be implemented by varying the values within avariable-sized coefficient kernel. The kernel sizes supported are 3×3,5×5 and 7×7 only.

[1274] Turning now to FIG. 82, there is illustrated 340 an example ofthe convolution process. The pixel component values fed into theconvolver process 341 come from a Box Read Iterator 342. The Iterator342 provides the image data row by row, and within each row, pixel bypixel. The output from the convolver 341 is sent to a Sequential WriteIterator 344, which stores the resultant image in a valid image format.

[1275] A Coefficient Kernel 346 is a lookup table in DRAM. The kernel isarranged with coefficients in the same order as the Box Read Iterator342. Each coefficient entry is 8 bits. A simple Sequential Read Iteratorcan be used to index into the kernel 346 and thus provide thecoefficients. It simulates an image with ImageWidth equal to the kernelsize, and a Loop option is set so that the kernel would continuously beprovided.

[1276] One form of implementation of the convolve process on an ALU unitis as illustrated in FIG. 81. The following constants are set bysoftware: Constant Value K₁ Kernel size (9, 25, or 49)

[1277] The control logic is used to count down the number ofmultiply/adds per pixel. When the count (accumulated in Latch₂) reaches0, the control signal generated is used to write out the currentconvolve value (from Latch₁) and to reset the count. In this way, onecontrol logic block can be used for a number of parallel convolvestreams.

[1278] Each cycle the multiply ALU can perform one multiply/add toincorporate the appropriate part of a pixel. The number of cycles takento sum up all the values is therefore the number of entries in thekernel. Since this is compute bound, it is appropriate to divide theimage into multiple sections and process them in parallel on differentALU units.

[1279] On a 7×7 kernel, the time taken for each pixel is 49 cycles, or490 ns. Since each cache line holds 32 pixels, the time available formemory access is 12,740 ns. ((32−7+1)×490 ns). The time taken to read 7cache lines and write 1 is worse case 1,120 ns (8*140 ns, all accessesto same DRAM bank). Consequently it is possible to process up to 10pixels in parallel given unlimited resources. Given a limited number ofALUs it is possible to do at best 4 in parallel. The time taken totherefore perform the convolution using a 7×7 kernel is 0.18375 seconds(1500*1000*490 ns/4=183,750,000 ns).

[1280] On a 5×5 kernel, the time taken for each pixel is 25 cycles, or250 ns. Since each cache line holds 32 pixels, the time available formemory access is 7,000 ns. ((32−5+1)×250 ns). The time taken to read 5cache lines and write 1 is worse case 840 ns (6*140 ns, all accesses tosame DRAM bank). Consequently it is possible to process up to 7 pixelsin parallel given unlimited resources. Given a limited number of ALUs itis possible to do at best 4. The time taken to therefore perform theconvolution using a 5×5 kernel is 0.09375 seconds (1500*1000*250ns/4=93,750,000 ns).

[1281] On a 3×3 kernel, the time taken for each pixel is 9 cycles, or 90ns. Since each cache line holds 32 pixels, the time available for memoryaccess is 2,700 ns. ((32−3+1)×90 ns). The time taken to read 3 cachelines and write 1 is worse case 560 ns (4*140 ns, all accesses to sameDRAM bank). Consequently it is possible to process up to 4 pixels inparallel given unlimited resources. Given a limited number of ALUs andRead/Write Iterators it is possible to do at best 4. The time taken totherefore perform the convolution using a 3×3 kernel is 0.03375 seconds(1500*1000*90 ns/4=33,750,000 ns).

[1282] Consequently each output pixel takes kernelsize/3 cycles tocompute. The actual timings are summarised in the following table: Timetaken to Time to process Time to Process calculate 1 channel at 3channels at Kernel size output pixel 1500 × 1000 1500 × 1000 3x3 (9)  3cycles 0.045 seconds 0.135 seconds 5x5 (25) 8 ⅓ cycles 0.125 seconds0.375 seconds 7x7 (49) 16 ⅓ cycles 0.245 seconds 0.735 seconds

[1283] Image Compositor

[1284] Compositing is to add a foreground image to a background imageusing a matte or a channel to govern the appropriate proportions ofbackground and foreground in the final image. Two styles of compositingare preferably supported, regular compositing and associatedcompositing. The rules for the two styles are:

[1285] Regular composite: new Value=Foreground+(Background−Foreground) a

[1286] Associated composite: new value=Foreground+(1−a) Background

[1287] The difference then, is that with associated compositing, theforeground has been pre-muitiplied with the matte, while in regularcompositing it has not. An example of the compositing process is asillustrated in FIG. 83.

[1288] The alpha channel has values from 0 to 255 corresponding to therange 0 to 1.

[1289] Regular Composite

[1290] A regular composite is implemented as:

Foreground+(Background−Foreground)*α./255

[1291] The division by X/255 is approximated by 257X/65536. Animplementation of the compositing process is shown in more detail inFIG. 84, where the following constant is set by software: Constant ValueK₁ 257

[1292] Since 4 Iterators are required, the composite process takes 1cycle per pixel, with a utilization of only half of the ALUs. Thecomposite process is only run on a single channel. To composite a3-channel image with another, the compositor must be run 3 times, oncefor each channel.

[1293] The time taken to composite a full size single channel is 0.015 s(1500*1000*1*10 ns), or 0.045 s to composite all 3 channels.

[1294] To approximate a divide by 255 it is possible to multiply by 257and then divide by 65536. It can also be achieved by a single add(256*x+x) and ignoring (except for rounding purposes) the final 16 bitsof the result.

[1295] As shown in FIG. 42, the compositor process requires 3 SequentialRead Iterators 351-353 and 1 Sequential Write Iterator 355, and isimplemented as microcode using a Adder ALU in conjunction with amultiplier ALU. Composite

[1296] time is 1 cycle (10 ns) per-pixel. Different microcode isrequired for associated and regular compositing, although the averagetime per pixel composite is the same.

[1297] The composite process is only run on a single channel. Tocomposite one 3-channel image with another, the compositor must be run 3times, once for each channel. As the a channel is the same for eachcomposite, it must be read each time. However it should be noted that totransfer (read or write) 4×32 byte cache-lines in the best case takes320 ns. The pipeline gives an average of 1 cycle per pixel composite,taking 32 cycles or 320 ns (at 100 MHz) to composite the 32 pixels, sothe a channel is effectively read for free. An entire channel cantherefore be composited in:

1500/32*1000*320 ns=15,040,000 ns=0.015 seconds.

[1298] The time taken to composite a full size 3 channel image istherefore 0.045 seconds.

[1299] Construct Image Pyramid

[1300] Several functions, such as warping, tiling and brushing, requirethe average value of a given area of pixels. Rather than calculate thevalue for each area given, these functions preferably make use of animage pyramid. As illustrated previously in FIG. 33, an image pyramid360 is effectively a multi-resolution pixelmap. The original image is a1:1 representation. Sub-sampling by 2:1 in each dimension produces animage ¼ the original size. This process continues until the entire imageis represented by a single pixel.

[1301] An image pyramid is constructed from an original image, andconsumes ⅓ of the size taken up by the original image (¼+{fraction(1/16)}+{fraction (1/64)}+ . . . ). For an original image of 1500×1000the corresponding image pyramid is approximately ½ MB

[1302] The image pyramid can be constructed via a 3×3 convolve performedon 1 in 4 input image pixels advancing the center of the convolve kernelby 2 pixels each dimension. A 3×3 convolve results in higher accuracythan simply averaging 4 pixels, and has the added advantage thatcoordinates on different pyramid levels differ only by shifting 1 bitper level.

[1303] The construction of an entire pyramid relies on a software loopthat calls the pyramid level construction function once for each levelof the pyramid.

[1304] The timing to produce 1 level of the pyramid is {fraction(9/4)}*¼ of the resolution of the input image since we are generating animage ¼ of the size of the original. Thus for a 1500×1000 image:

[1305] Timing to produce level 1 of pyramid={fraction(9/4)}*750*500=843, 750 cycles

[1306] Timing to produce level 2 of pyramid={fraction(9/4)}*375*250=210, 938 cycles

[1307] Timing to produce level 3 of pyramid={fraction (9/4)}*188*125=52,735 cycles Etc.

[1308] The total time is ¾ cycle per original image pixel (image pyramidis ⅓ of original image size, and each pixel takes {fraction (9/4)}cycles to be calculated, i.e. ⅓*{fraction (9/4)}=¾). In the case of a1500×1000 image is 1,125,000 cycles (at 100 MHz), or 0.011 seconds. Thistiming is for a single color channel, 3 color channels require 0.034seconds processing time.

[1309] General Data Driven Image Warper

[1310] The ACP 31 is able to carry out image warping manipulations ofthe input image. The principles of image warping are well-known intheory. One thorough text book reference on the process of warping is“Digital Image Warping” by George Wolberg published in 1990 by the IEEEComputer Society Press, Los Alamitos, Calif. The warping processutilizes a warp map which forms part of the data fed in via Artcard 9.The warp map can be arbitrarily dimensioned in accordance withrequirements and provides information of a mapping of input pixels tooutput pixels. Unfortunately, the utilization of arbitrarily sized warpmaps presents a number of problems which must be solved by the imagewarper.

[1311] Turning to FIG. 85, a warp map 365, having dimensions A×Bcomprises array values of a certain magnitude (for example 8 bit valuesfrom 0-255) which set out the coordinate of a theoretical input imagewhich maps to the corresponding “theoretical” output image having thesame array coordinate indices. Unfortunately, any output image eg. 366will have its own dimensions C×D which may further be totally differentfrom an input image which may have its own dimensions E×F. Hence, it isnecessary to facilitate the remapping of the warp map 365 so that it canbe utilised for output image 366 to determine, for each output pixel,the corresponding area or region of the input image 367 from which theoutput pixel color data is to be constructed. For each output pixel inoutput image 366 it is necessary to first determine a corresponding warpmap value from warp map 365. This may include the need to bilinearlyinterpolate the surrounding warp map values when an output image pixelmaps to a fractional position within warp map table 365. The result ofthis process will give the location of an input image pixel in a“theoretical” image which will be dimensioned by the size of each datavalue within the warp map 365. These values must be re-scaled so as tomap the theoretical image to the corresponding actual input image 367.

[1312] In order to determine the actual value and output image pixelshould take so as to avoid aliasing effects, adjacent output imagepixels should be examined to determine a region of input image pixels367 which will contribute to the final output image pixel value. In thisrespect, the image pyramid is utilised as will become more apparenthereinafter.

[1313] The image warper performs several tasks in order to warp animage.

[1314] Scale the warp map to match the output image size.

[1315] Determine the span of the region of input image pixelsrepresented in each output pixel.

[1316] Calculate the final output pixel value via tri-linearinterpolation from the input image pyramid

[1317] Scale Warp Map

[1318] As noted previously, in a data driven warp, there is the need fora warp map that describes, for each output pixel, the center of acorresponding input image map. Instead of having a single warp map aspreviously described, containing interleaved x and y value information,it is possible to treat the X and Y coordinates as separate channels.

[1319] Consequently, preferably there are two warp maps: an X warp mapshowing the warping of X coordinates, and a Y warp map, showing thewarping of the Y coordinates. As noted previously, the warp map 365 canhave a different spatial resolution than the image they being scaled(for example a 32×32 warp-map 365 may adequately describe a warp for a1500×1000 image 366). In addition, the warp maps can be represented by 8or 16 bit values that correspond to the size of the image being warped.

[1320] There are several steps involved in producing points in the inputimage space from a given warp map:

[1321] 1. Determining the corresponding position in the warp map for theoutput pixel

[1322] 2. Fetch the values from the warp map for the next step (this canrequire scaling in the resolution domain if the warp map is only 8 bitvalues)

[1323] 3. Bi-linear interpolation of the warp map to determine theactual value

[1324] 4. Scaling the value to correspond to the input image domain

[1325] The first step can be accomplished by multiplying the current X/Ycoordinate in the output image by a scale factor (which can be differentin X & Y). For example, if the output image was 1500×1000, and the warpmap was 150×100, we scale both X & Y by 1/10.

[1326] Fetching the values from the warp map requires access to 2 Lookuptables. One Lookup table indexes into the X warp-map, and the otherindexes into the Y warp-map. The lookup table either reads 8 or 16 bitentries from the lookup table, but always returns 16 bit values(clearing the high 8 bits if the original values are only 8 bits).

[1327] The next step in the pipeline is to bi-linearly interpolate thelooked-up warp map values.

[1328] Finally the result from the bi-linear interpolation is scaled toplace it in the same domain as the image to be warped. Thus, if the warpmap range was 0-255, we scale X by 1500/255, and Y by 1000/255.

[1329] The interpolation process is as illustrated in FIG. 86 with thefollowing constants set by software: Constant Value K₁ Xscale (scales0-ImageWidth to 0-WarpmapWidth) K₂ Yscale (scales 0-ImageHeight to0-WarpmapHeight) K₃ XrangeScale (scales warpmap range (eg 0-255) to 0-ImageWidth) K₄ YrangeScale (scales warpmap range (eg 0-255) to 0-ImageHeight)

[1330] The following lookup table is used: Lookup Size Details LU₁ andWarpmapWidth × Warpmap lookup. LU₂ WarpmapHeight Given [X,Y] the 4entries required for bi-linear interpolation are returned. Even ifentries are only 8 bit, they are returned as 16 bit (high 8 bits 0).Transfer time is 4 entries at 2 bytes per entry. Total time is 8 cyclesas 2 lookups are used.

[1331] Span Calculation

[1332] The points from the warp map 365 locate centers of pixel regionsin the input image 367. The distance between input image pixels ofadjacent output image pixels will indicate the size of the regions, andthis distance can be approximated via a span calculation.

[1333] Turning to FIG. 87, for a given current point in the warp map P1,the previous point on the same line is called P0, and the previousline's point at the same position is called P2. We determine theabsolute distance in X & Y between P1 and P0, and between P1 and P2. Themaximum distance in X or Y becomes the span which will be a squareapproximation of the actual shape.

[1334] Preferably, the points are processed in a vertical strip outputorder, P0 is the previous point on the same line within a strip, andwhen P1 is the first point on line within a strip, then P0 refers to thelast point in the previous strip's corresponding line. P2 is theprevious line's point in the same strip, so it can be kept in a 32-entryhistory buffer. The basic of the calculate span process are asillustrated in FIG. 88 with the details of the process as illustrated inFIG. 89.

[1335] The following DRAM FIFO is used: Lookup Size Details FIFO₁ 8ImageWidth bytes. P2 history/lookup (both X & Y in [ImageWidth × 2 sameFIFO) entries at 32 bits P1 is put into the FIFO and taken per entry]out again at the same pixel on the following row as P2. Transfer time is4 cycles (2 × 32 bits, with 1 cycle per 16 bits)

[1336] Since a 32 bit precision span history is kept, in the case of a1500 pixel wide image being warped 12,000 bytes temporary storage isrequired.

[1337] Calculation of the span 364 uses 2 Adder ALUs (1 for spancalculation, 1 for looping and counting for P0 and P2 histories) takes 7cycles as follows: Cycle Action 1 A = ABS(P1_(x) − P2_(x)) Store P1_(x)in P2_(x) history 2 B = ABS(P1_(x) − P0_(x)) Store P1_(x) in P0_(x)history 3 A = MAX(A, B) 4 B = ABS(P1_(y) − P2_(y)) Store P1_(y) inP2_(y) history 5 A = MAX(A, B) 6 B = ABS(P1_(y) − P0_(y)) Store P1_(y)in P0_(y) history 7 A = MAX(A, B)

[1338] The history buffers 365, 366 are cached DRAM. The ‘Previous Line’(for P2 history) buffer 366 is 32 entries of span-precision. The‘Previous Point’ (for P0 history). Buffer 365 requires 1 register thatis used most of the time (for calculation of points 1 to 31 of a line ina strip), and a DRAM buffered set of history values to be used in thecalculation of point 0 in a strip's line.

[1339] 32 bit precision in span history requires 4 cache lines to holdP2 history, and 2 for P0 history. P0's history is only written and readout once every 8 lines of 32 pixels to a temporary storage space of(ImageHeight*4) bytes. Thus a 1500 pixel high image being warpedrequires 6000 bytes temporary storage, and a total of 6 cache lines.

[1340] Tri-Linear Interpolation

[1341] Having determined the center and span of the area from the inputimage to be averaged, the final part of the warp process is to determinethe value of the output pixel. Since a single output pixel couldtheoretically be represented by the entire input image, it ispotentially too time-consuming to actually read and average the specificarea of the input image contributing to the output pixel. Instead, it ispossible to approximate the pixel value by using an image pyramid of theinput image.

[1342] If the span is 1 or less, it is necessary only to read theoriginal image's pixels around the given coordinate, and performbi-linear interpolation. If the span is greater than 1, we must read twoappropriate levels of the image pyramid and perform tri-linearinterpolation. Performing linear interpolation between two levels of theimage pyramid is not strictly correct, but gives acceptable results (iterrs on the side of blurring the resultant image).

[1343] Turning to FIG. 90, generally speaking, for a given span ‘s’, itis necessary to read image pyramid levels given by ln₂s (370) and ln₂s+1(371). Ln₂s is simply decoding the highest set bit of s. We mustbi-linear interpolate to determine the value for the pixel value on eachof the two levels 370,371 of the pyramid, and then interpolate betweenlevels.

[1344] As shown in FIG. 91, it is necessary to first interpolate in Xand Y for each pyramid level before interpolating between the pyramidlevels to obtain a final output value 373.

[1345] The image pyramid address mode issued to generate addresses forpixel coordinates at (x, y) on pyramid level s & s+1. Each level of theimage pyramid contains pixels sequential in x. Hence, reads in x arelikely to be cache hits.

[1346] Reasonable cache coherence can be obtained as local regions inthe output image are typically locally coherent in the input image(perhaps at a different scale however, but coherent within the scale).Since it is not possible to know the relationship between the input andoutput images, we ensure that output pixels are written in a verticalstrip (via a Vertical-Strip Iterator) in order to best make use of cachecoherence.

[1347] Tri-linear interpolation can be completed in as few as 2 cycleson average using 4 multiply ALUs and all 4 adder ALUs as a pipeline andassuming no memory access required. But since all the interpolationvalues are derived from the image pyramids, interpolation speed iscompletely dependent on cache coherence (not to mention the other unitsare busy doing warp-map scaling and span calculations). As many cachelines as possible should therefore be available to the image-pyramidreading. The best speed will be 8 cycles, using 2 Multiply ALUs.

[1348] The output pixels are written out to the DRAM via aVertical-Strip Write Iterator that uses 2 cache lines. The speed istherefore limited to a minimum of 8 cycles per output pixel. If thescaling of the warp map requires 8 or fewer cycles, then the overallspeed will be unchanged. Otherwise the throughput is the time taken toscale the warp map. In most cases the warp map will be scaled up tomatch the size of the photo.

[1349] Assuming a warp map that requires 8 or fewer cycles per pixel toscale, the time taken to convert a single color component of image istherefore 0.12 s (1500*1000*8 cycles*10 ns per cycle).

[1350] Histogram Collector

[1351] The histogram collector is a microcode program that takes animage channel as input, and produces a histogram as output. Each of achannel's pixels has a value in the range 0-255. Consequently there are256 entries in the histogram table, each entry 32 bits—large enough tocontain a count of an entire 1500×1000 image.

[1352] As shown in FIG. 92, since the histogram represents a summary ofthe entire image, a Sequential Read Iterator 378 is sufficient for theinput. The histogram itself can be completely cached, requiring 32 cachelines (1K).

[1353] The microcode has two passes: an initialization pass which setsall the counts to zero, and then a “count” stage that increments theappropriate counter for each pixel read from the image. The first stagerequires the Address Unit and a single Adder ALU, with the address ofthe histogram table 377 for initialising. Relative Address UnitMicrocode A = Base address of Address histogram Adder Unit 1 0 Write 0to Out1 = A A + (Adder 1.Out 1 << 2) A = A − 1 BNZ 0 1 Rest ofprocessing Rest of processing

[1354] The second stage processes the actual pixels from the image, anduses 4 Adder ALUs: Adder 1 Adder 2 Adder 3 Adder 4 Address Unit 1 A = 0A = −1 2 Out1 = A = A = A = A + 1 Out1 = Read 4 BZ A Adder1.Out1Adr.Out1 bytes from: (A + 2 A = Z = pixel − (Adder1.Out1 << pixelAdder1.Out1 2)) 3 Out1 = A Out1 = A Out1 = A Write A = Adder4.Out1 to:Adder3.Out (A + (Adder 1 2.Out << 2) 4 Write Adder4.Out1 to: (A + (Adder2.Out << 2) Flush caches

[1355] The Zero flag from Adder2 cycle 2 is used to stay at microcodeaddress 2 for as long as the input pixel is the same. When it changes,the new count is written out in microcode address 3, and processingresumes at microcode address 2. Microcode address 4 is used at the end,when there are no more pixels to be read.

[1356] Stage 1 takes 256 cycles, or 2560 ns. Stage 2 varies according tothe values of the pixels. The worst case time for lookup tablereplacement is 2 cycles per image pixel if every pixel is not the sameas its neighbor. The time taken for a single color lookup is 0.03 s(1500×1000×2 cycle per pixel×10 ns per cycle=30,000,000 ns). The timetaken for 3 color components is 3 times this amount, or 0.09 s.

[1357] Color Transform

[1358] Color transformation is achieved in two main ways:

[1359] Lookup table replacement

[1360] Color space conversion

[1361] Lookup Table Replacement

[1362] As illustrated in FIG. 86, one of the simplest ways to transformthe color of a pixel is to encode an arbitrarily complex transformfunction into a lookup table 380. The component color value of the pixelis used to lookup 381 the new component value of the pixel. For eachpixel read from a Sequential Read Iterator, its new value is read fromthe New Color Table 380, and written to a Sequential Write Iterator 383.The input image can be processed simultaneously in two halves to makeeffective use of memory bandwidth. The following lookup table is used:Lookup Size Details LU₁ 256 entries Replacement [X] 8 bits per Tableindexed by the 8 highest significant entry bits of X. Resultant 8 bitstreated as fixed point 0:8

[1363] The total process requires 2 Sequential Read Iterators and 2Sequential Write iterators. The 2 New Color Tables require 8 cache lineseach to hold the 256 bytes (256 entries of 1 byte).

[1364] The average time for lookup table replacement is therefore ½cycle per image pixel. The time taken for a single color lookup is0.0075 s (1500×1000×½ cycle per pixel×10 ns per cycle=7,500,000 ns). Thetime taken for 3 color components is 3 times this amount, or 0.0225 s.Each color component has to be processed one after the other undercontrol of software.

[1365] Color Space Conversion

[1366] Color Space conversion is only required when moving between colorspaces. The CCD images are captured in RGB color space, and printingoccurs in CMY color space, while clients of the ACP 31 likely processimages in the Lab color space. All of the input color space channels aretypically required as input to determine each output channel's componentvalue. Thus the logical process is as illustrated 385 in FIG. 94.

[1367] Simply, conversion between Lab, RGB, and CMY is fairlystraightforward. However the individual color profile of a particulardevice can vary considerably. Consequently, to allow future CCDs, inks,and printers, the ACP 31 performs color space conversion by means oftri-linear interpolation from color space conversion lookup tables.

[1368] Color coherence tends to be area based rather than line based. Toaid cache coherence during tri-linear interpolation lookups, it is bestto process an image in vertical strips. Thus the read 386-388 and write389 iterators would be Vertical-Strip Iterators.

[1369] Tri-Linear Color Space Conversion

[1370] For each output color component, a single 3D table mapping theinput color space to the output color component is required. Forexample, to convert CCD images from RGB to Lab, 3 tables calibrated tothe physical characteristics of the CCD are required:

[1371] RGB→L

[1372] RGB→a

[1373] RGB→b

[1374] To convert from Lab to CMY, 3 tables calibrated to the physicalcharacteristics of the ink/printer are required:

[1375] Lab→C

[1376] Lab→M

[1377] Lab→Y

[1378] The 8-bit input color components are treated as fixed-pointnumbers (3:5) in order to index into the conversion tables. The 3 bitsof integer give the index, and the 5 bits of fraction are used forinterpolation. Since 3 bits gives 8 values, 3 dimensions gives 512entries (8×8×8). The size of each entry is 1 byte, requiring 512 bytesper table.

[1379] The Convert Color Space process can therefore be implemented asshown in FIG. 95 and the following lookup table is used: Lookup SizeDetails LU₁ 8 x 8 x 8 Convert [X, Y, Z] entries Table indexed by the 3highest bits of X, 512 entries Y, and Z. 8 bits per 8 entries returnedfrom Tri-linear index entry address unit Resultant 8 bits treated asfixed point 8:0 Transfer time is 8 entries at 1 byte per entry

[1380] Tri-linear interpolation returns interpolation between 8 values.Each 8 bit value takes 1 cycle to be returned from the lookup, for atotal of 8 cycles. The tri-linear interpolation also takes 8 cycles when2 Multiply ALUs are used per cycle. General tri-linear interpolationinformation is given in the ALU section of this document. The 512 bytesfor the lookup table fits in 16 cache lines.

[1381] The time taken to convert a single color component of image istherefore 0.105 s (1500*1000*7 cycles*10 ns per cycle). To convert 3components takes 0.415 s. Fortunately, the color space conversion forprintout takes place on the fly during printout itself, so is not aperceived delay.

[1382] If color components are converted separately, they must notoverwrite their input color space components since all color componentsfrom the input color space are required for converting each component.

[1383] Since only 1 multiply unit is used to perform the interpolation,it is alternatively possible to do the entire Lab→CMY conversion as asingle pass. This would require 3 Vertical-Strip Read Iterators, 3Vertical-Strip Write Iterators, and access to 3 conversion tablessimultaneously. In that case, it is possible to write back onto theinput image and thus use no extra memory. However, access to 3conversion tables equals ⅓ of the caching for each, that could lead tohigh latency for the overall process.

[1384] Affine Transform

[1385] Prior to compositing an image with a photo, it may be necessaryto rotate, scale and translate it. If the image is only beingtranslated, it can be faster to use a direct sub-pixel translationfunction. However, rotation, scale-up and translation can all beincorporated into a single affine transform.

[1386] A general affine transform can be included as an acceleratedfunction. Affine transforms are limited to 2D, and if scaling down,input images should be pre-scaled via the Scale function. Having ageneral affine transform function allows an output image to beconstructed one block at a time, and can reduce the time taken toperform a number of transformations on an image since all can be appliedat the same time.

[1387] A transformation matrix needs to be supplied by the client—thematrix should be the inverse matrix of the transformation desired i.e.applying the matrix to the output pixel coordinate will give the inputcoordinate.

[1388] A 2D matrix is usually represented as a 3×3 array:$\quad\begin{bmatrix}a & b & 0 \\c & d & 0 \\e & f & 1\end{bmatrix}$

[1389] Since the 3^(rd) column is always[0, 0, 1] clients do not need tospecify it. Clients instead specify a, b, c, d, e, and f.

[1390] Given a coordinate in the output image (x, y) whose top leftpixel coordinate is given as (0, 0), the input coordinate is specifiedby: (ax+cy+e, bx+dy+f). Once the input coordinate is determined, theinput image is sampled to arrive at the pixel value. Bi-linearinterpolation of input image pixels is used to determine the value ofthe pixel at the calculated coordinate. Since affine transforms preserveparallel lines, images are processed in output vertical strips of 32pixels wide for best average input image cache coherence.

[1391] Three Multiply ALUs are required to perform the bi-linearinterpolation in 2 cycles. Multiply ALUs 1 and 2 do linear interpolationin X for lines Y and Y+1 respectively, and Multiply ALU 3 does linearinterpolation in Y between the values output by Multiply ALUs 1 and 2.

[1392] As we move to the right across an output line in X, 2 Adder ALUscalculate the actual input image coordinates by adding ‘a’ to thecurrent X value, and ‘b’ to the current Y value respectively. When weadvance to the next line (either the next line in a vertical strip afterprocessing a maximum of 32 pixels, or to the first line in a newvertical strip) we update X and Y to pre-calculated start coordinatevalues constants for the given block

[1393] The process for calculating an input coordinate is given in FIG.96 where the following constants are set by software:

[1394] Calculate Pixel

[1395] Once we have the input image coordinates, the input image must besampled. A lookup table is used to return the values at the specifiedcoordinates in readiness for bilinear interpolation. The basic processis as indicated in FIG. 97 and the following lookup table is used:Lookup Size Details LU₁ Image Bilinear Image lookup [X, Y] width Tableindexed by the integer part of X and Y. by 4 entries returned fromBilinear index address Image unit, 2 per cycle. height Each 8 bit entrytreated as fixed point 8:0 8 bits Transfer time is 2 cycles (2 16 bitentries in per FIFO hold the 4 8 bit entries) entry

[1396] The affine transform requires all 4 Multiply Units and all 4Adder ALUs, and with good cache coherence can perform an affinetransform with an average of 2 cycles per output pixel. This timingassumes good cache coherence, which is true for non-skewed images. Worstcase timings are severely skewed images, which meaningful Vark scriptsare unlikely to contain.

[1397] The time taken to transform a 128×128 image is therefore 0.00033seconds (32,768 cycles). If this is a clip image with 4 channels(including a channel), the total time taken is 0.00131 seconds (131,072cycles).

[1398] A Vertical-Strip Write Iterator is required to output the pixels.No Read Iterator is required. However, since the affine transformaccelerator is bound by time taken to access input image pixels, as manycache lines as possible should be allocated to the read of pixels fromthe input image. At least 32 should be available, and preferably 64 ormore.

[1399] Scaling

[1400] Scaling is essentially a re-sampling of an image. Scale up of animage can be performed using the Affine Transform function. Generalizedscaling of an image, including scale down, is performed by the hardwareaccelerated Scale function. Scaling is performed independently in X andY, so different scale factors can be used in each dimension.

[1401] The generalized scale unit must match the Affine Transform scalefunction in terms of registration. The generalized scaling process is asillustrated in FIG. 98. The scale in X is accomplished by Fant'sre-sampling algorithm as illustrated in FIG. 99.

[1402] Where the following constants are set by software: Constant ValueK₁ Number of input pixels that contribute to an output pixel in X K₂1/K₁

[1403] The following registers are used to hold temporary variables:Variable Value Latch₁ Amount of input pixel remaining unused (starts at1 and decrements) Latch₂ Amount of input pixels remaining to contributeto current output pixel (starts at K₁ and decrements) Latch₃ Next pixel(in X) Latch₄ Current pixel Latch₅ Accumulator for output pixel(unsealed) Latch₆ Pixel Scaled in X (output)

[1404] The Scale in Y process is illustrated in FIG. 100 and is alsoaccomplished by a slightly altered version of Fant's re-samplingalgorithm to account for processing in order of X pixels.

[1405] Where the following constants are set by software: Constant ValueK₁ Number of input pixels that contribute to an output pixel in Y K₂1/K₁

[1406] The following registers are used to hold temporary variables:Variable Value Latch₁ Amount of input pixel remaining unused (starts at1 and decrements) Latch₂ Amount of input pixels remaining to contributeto current output pixel (starts at K₁and decrements) Latch₃ Next pixel(in Y) Latch₄ Current pixel Latch₅ Pixel Scaled in Y (output)

[1407] The following DRAM FIFOs are used: Lookup Size Details FIFO₁ImageWidth_(OUT) entries 1 row of image pixels already 8 bits per entryscaled in X 1 cycle transfer time FIFO₂ ImageWidth_(OUT) entries 1 rowof image pixels already 16 bits per entry scaled in X 2 cycles transfertime (1 byte per cycle)

[1408] Tessellate Image

[1409] Tessellation of an image is a form of tiling. It involves copyinga specially designed “tile” multiple times horizontally and verticallyinto a second (usually larger) image space. When tessellated, the smalltile forms a seamless picture. One example of this is a small tile of asection of a brick wall. It is designed so that when tessellated, itforms a full brick wall. Note that there is no scaling or sub-pixeltranslation involved in tessellation.

[1410] The most cache-coherent way to perform tessellation is to outputthe image sequentially line by line, and to repeat the same line of theinput image for the duration of the line. When we finish the line, theinput image must also advance to the next line (and repeat it multipletimes across the output line).

[1411] An overview of the tessellation function is illustrated 390 inFIG. 101. The Sequential Read Iterator 392 is set up to continuouslyread a single line of the input tile (StartLine would be 0 and EndLinewould be 1). Each input pixel is written to all 3 of the Write Iterators393-395. A counter 397 in an Adder ALU counts down the number of pixelsin an output line, terminating the sequence at the end of the line.

[1412] At the end of processing a line, a small software routine updatesthe Sequential Read Iterator's StartLine and EndLine registers beforerestarting the microcode and the Sequential Read Iterator (which clearsthe FIFO and repeats line 2 of the tile). The Write Iterators 393-395are not updated, and simply keep on writing out to their respectiveparts of the output image. The net effect is that the tile has one linerepeated across an output line, and then the tile is repeated verticallytoo.

[1413] This process does not fully use the memory bandwidth since we getgood cache coherence in the input image, but it does allow thetessellation to function with tiles of any size. The process uses 1Adder ALU. If the 3 Write Iterators 393-395 each write to ⅓ of the image(breaking the image on tile sized boundaries), then the entiretessellation process takes place at an average speed of ⅓ cycle peroutput image pixel. For an image of 1500×1000, this equates to 0.005seconds (5,000,000 ns).

[1414] Sub-Pixel Translator

[1415] Before compositing an image with a background, it may benecessary to translate it by a sub-pixel amount in both X and Y.Sub-pixel transforms can increase an image's size by 1 pixel in eachdimension. The value of the region outside the image can be clientdetermined, such as a constant value (e.g. black), or edge pixelreplication. Typically it will be better to use black.

[1416] The sub-pixel translation process is as illustrated in FIG. 102.Sub-pixel translation in a given dimension is defined by:

Pixel_(out)=Pixel_(in)*(1-Translation)+Pixel_(in−1)*Translation

[1417] It can also be represented as a form of interpolation:

[1418] Pixel_(out)=Pixel_(in−1)+(Pixel_(in)−Pixel_(in−1))*Translation

[1419] Implementation of a single (on average) cycle interpolationengine using a single Multiply ALU and a single Adder ALU in conjunctionis straightforward. Sub-pixel translation in both X & Y requires 2interpolation engines.

[1420] In order to sub-pixel translate in Y, 2 Sequential Read Iterators400, 401 are required (one is reading a line ahead of the other from thesame image), and a single Sequential Write Iterator 403 is required.

[1421] The first interpolation engine (interpolation in Y) accepts pairsof data from 2 streams, and linearly interpolates between them. Thesecond interpolation engine (interpolation in X) accepts its data as asingle 1 dimensional stream and linearly interpolates between values.Both engines interpolate in 1 cycle on average.

[1422] Each interpolation engine 405, 406 is capable of performing thesub-pixel translation in 1 cycle per output pixel on average. Theoverall time is therefore 1 cycle per output pixel, with requirements of2 Multiply ALUs and 2 Adder ALUs.

[1423] The time taken to output 32 pixels from the sub-pixel translatefunction is on average 320 ns (32 cycles). This is enough time for 4full cache-line accesses to DRAM, so the use of 3 Sequential Iteratorsis well within timing limits.

[1424] The total time taken to sub-pixel translate an image is therefore1 cycle per pixel of the output image. A typical image to be sub-pixeltranslated is a tile of size 128*128. The output image size is 129*129.The process takes 129*129*10 ns=166,410 ns.

[1425] The Image Tiler function also makes use of the sub-pixeltranslation algorithm, but does not require the writing out of thesub-pixel-translated data, but rather processes it further.

[1426] Image Tiler

[1427] The high level algorithm for tiling an image is carried out insoftware. Once the placement of the tile has been determined, theappropriate colored tile must be composited. The actual compositing ofeach tile onto an image is carried out in hardware via the microcodedALUs. Compositing a tile involves both a texture application and a colorapplication to a background image. In some cases it is desirable tocompare the actual amount of texture added to the background in relationto the intended amount of texture, and use this to scale the color beingapplied. In these cases the texture must be applied first.

[1428] Since color application functionality and texture applicationfunctionality are somewhat independent, they are separated intosub-functions.

[1429] The number of cycles per 4-channel tile composite for thedifferent texture styles and coloring styles is summarised in thefollowing table: Constant Pixel color color Replace texture 4 4.75 25%background + tile texture 4 4.75 Average height algorithm 5 5.75 Averageheight algorithm 5.75 6.5 with feedback

[1430] Tile Coloring and Compositing

[1431] A tile is set to have either a constant color (for the wholetile), or takes each pixel value from an input image. Both of thesecases may also have feedback from a texturing stage to scale the opacity(similar to thinning paint).

[1432] The steps for the 4 cases can be summarised as:

[1433] Sub-pixel translate the tile's opacity values,

[1434] Optionally scale the tile's opacity (if feedback from textureapplication is enabled).

[1435] Determine the color of the pixel (constant or from an image map).

[1436] Composite the pixel onto the background image.

[1437] Each of the 4 cases is treated separately, in order to minimizethe time taken to perform the function. The summary of time per colorcompositing style for a single color channel is described in thefollowing table: No feedback Feedback from from texture texture (cyclesper (cycles per Tiling color style pixel) pixel) Tile has constant colorper pixel 1 2 Tile has per pixel color from 1.25 2 input image

[1438] Constant Color

[1439] In this case, the tile has a constant color, determined bysoftware. While the ACP 31 is placing down one tile, the software can bedetermining the placement and coloring of the next tile.

[1440] The color of the tile can be determined by bi-linearinterpolation into a scaled version of the image being tiled. The scaledversion of the image can be created and stored in place of the imagepyramid, and needs only to be performed once per entire tile operation.If the tile size is 128×128, then the image can be scaled down by 128:1in each dimension.

[1441] Without Feedback

[1442] When there is no feedback from the texturing of a tile, the tileis simply placed at the specified coordinates. The tile color is usedfor each pixel's color, and the opacity for the composite comes from thetile's sub-pixel translated opacity channel. In this case color channelsand the texture channel can be processed completely independentlybetween tiling passes.

[1443] The overview of the process is illustrated in FIG. 103. Sub-pixeltranslation 410 of a tile can be accomplished using 2 Multiply ALUs and2 Adder ALUs in an average time of 1 cycle per output pixel. The outputfrom the sub-pixel translation is the mask to be used in compositing 411the constant tile color 412 with the background image from backgroundsequential Read Iterator.

[1444] Compositing can be performed using 1 Multiply ALU and 1 Adder ALUin an average time of 1 cycle per composite. Requirements are therefore3 Multiply ALUs and 3 Adder ALUs. 4 Sequential Iterators 413-416 arerequired, taking 320 ns to read or write their contents. With an averagenumber of cycles of 1 per pixel to sub-pixel translate and composite,there is sufficient time to read and write the buffers.

[1445] With Feedback

[1446] When there is feedback from the texturing of a tile, the tile isplaced at the specified coordinates. The tile color is used for eachpixel's color, and the opacity for the composite comes from the tile'ssub-pixel translated opacity channel scaled by the feedback parameter.Thus the texture values must be calculated before the color value isapplied.

[1447] The overview of the process is illustrated in FIG. 97. Sub-pixeltranslation of a tile can be accomplished using 2 Multiply ALUs and 2Adder ALUs in an average time of 1 cycle per output pixel. The outputfrom the sub-pixel translation is the mask to be scaled according to thefeedback read from the Feedback Sequential Read Iterator 420. Thefeedback is passed it to a Scaler (1 Multiply ALU) 421.

[1448] Compositing 422 can be performed using 1 Multiply ALU and 1 AdderALU in an average time of 1 cycle per composite. Requirements aretherefore 4 Multiply ALUs and all 4 Adder ALUs. Although the entireprocess can be accomplished in 1 cycle on average, the bottleneck is thememory access, since 5 Sequential Iterators are required. Withsufficient buffering, the average time is 1.25 cycles per pixel.

[1449] Color from Input Image

[1450] One way of coloring pixels in a tile is to take the color frompixels in an input image. Again, there are two possibilities forcompositing: with and without feedback from the texturing.

[1451] Without Feedback

[1452] In this case, the tile color simply comes from the relative pixelin the input image. The opacity for compositing comes from the tile'sopacity channel sub-pixel shifted.

[1453] The overview of the process is illustrated in FIG. 105. Sub-pixeltranslation 425 of a tile can be accomplished using 2 Multiply ALUs and2 Adder ALUs in an average time of 1 cycle per output pixel. The outputfrom the sub-pixel translation is the mask to be used in compositing 426the tile's pixel color (read from the input image 428) with thebackground image 429.

[1454] Compositing 426 can be performed using 1 Multiply ALU and 1 AdderALU in an average time of 1 cycle per composite. Requirements aretherefore 3 Multiply ALUs and 3 Adder ALUs. Although the entire processcan be accomplished in 1 cycle on average, the bottleneck is the memoryaccess, since 5 Sequential Iterators are required. With sufficientbuffering, the average time is 1.25 cycles per pixel.

[1455] With Feedback

[1456] In this case, the tile color still comes from the relative pixelin the input image, but the opacity for compositing is affected by therelative amount of texture height actually applied during the texturingpass. This process is as illustrated in FIG. 106.

[1457] Sub-pixel translation 431 of a tile can be accomplished using 2Multiply ALUs and 2 Adder ALUs in an average time of 1 cycle per outputpixel. The output from the sub-pixel translation is the mask to bescaled 431 according to the feedback read from the Feedback SequentialRead Iterator 432. The feedback is passed to a Scaler (1 Multiply ALU)431.

[1458] Compositing 434 can be performed using 1 Multiply ALU and 1 AdderALU in an average time of 1 cycle per composite.

[1459] Requirements are therefore all 4 Multiply ALUs and 3 Adder ALUs.Although the entire process can be accomplished in 1 cycle on average,the bottleneck is the memory access, since 6 Sequential Iterators arerequired. With sufficient buffering, the average time is 1.5 cycles perpixel.

[1460] Tile Texturing

[1461] Each tile has a surface texture defined by its texture channel.The texture must be sub-pixel translated and then applied to the outputimage. There are 3 styles of texture compositing:

[1462] Replace texture

[1463] 25% background+tile's texture

[1464] Average height algorithm

[1465] In addition, the Average height algorithm can save feedbackparameters for color compositing.

[1466] The time taken per texture compositing style is summarised in thefollowing table: Cycles per Cycles per pixel pixel (no feedback(feedback Tiling color style from texture) from texture) Replace texture1 — 25% background + tile texture 1 — value Average height algorithm 2 2

[1467] Replace Texture

[1468] In this instance, the texture from the tile replaces the texturechannel of the image, as illustrated in FIG. 107. Sub-pixel translation436 of a tile's texture can be accomplished using 2 Multiply ALUs and 2Adder ALUs in an average time of 1 cycle per output pixel. The outputfrom this sub-pixel translation is fed directly to the Sequential WriteIterator 437.

[1469] The time taken for replace texture compositing is 1 cycle perpixel. There is no feedback, since 100% of the texture value is alwaysapplied to the background. There is therefore no requirement forprocessing the channels in any particular order.

[1470] 25% Background+Tile's Texture

[1471] In this instance, the texture from the tile is added to 25% ofthe existing texture value. The new value must be greater than or equalto the original value. In addition, the new texture value must beclipped at 255 since the texture channel is only 8 bits. The processutilised is illustrated in FIG. 108.

[1472] Sub-pixel translation 440 of a tile's texture can be accomplishedusing 2 Multiply ALUs and 2 Adder ALUs in an average time of 1 cycle peroutput pixel. The output from this sub-pixel translation 440 is fed toan adder 441 where it is added to ¼ 442 of the background texture value.Min and Max functions 444 are provided by the 2 adders not used forsub-pixel translation and the output written to a Sequential WriteIterator 445.

[1473] The time taken for this style of texture compositing is 1 cycleper pixel. There is no feedback, since 100% of the texture value isconsidered to have been applied to the background (even if clipping at255 occurred). There is therefore no requirement for processing thechannels in any particular order.

[1474] Average Height Algorithm

[1475] In this texture application algorithm, the average height underthe tile is computed, and each pixel's height is compared to the averageheight. If the pixel's height is less than the average, the strokeheight is added to the background height. If the pixel's height isgreater than or equal to the average, then the stroke height is added tothe average height. Thus background peaks thin the stroke. The height isconstrained to increase by a minimum amount to prevent the backgroundfrom thinning the stroke application to 0 (the minimum amount can be 0however). The height is also clipped at 255 due to the 8-bit resolutionof the texture channel.

[1476] There can be feedback of the difference in texture applied versusthe expected amount applied. The feedback amount can be used as a scalefactor in the application of the tile's color.

[1477] In both cases, the average texture is provided by software,calculated by performing a bi-level interpolation on a scaled version ofthe texture map. Software determines the next tile's average textureheight while the current tile is being applied. Software must alsoprovide the minimum thickness for addition, which is typically constantfor the entire tiling process.

[1478] Without Feedback

[1479] With no feedback, the texture is simply applied to the backgroundtexture, as shown in FIG. 109.

[1480] 4 Sequential Iterators are required, which means that if theprocess can be pipelined for 1 cycle, the memory is fast enough to keepup.

[1481] Sub-pixel translation 450 of a tile's texture can be accomplishedusing 2 Multiply ALUs and 2 Adder ALUs in an average time of 1 cycle peroutput pixel. Each Min & Max function 451,452 requires a separate AdderALU in order to complete the entire operation in 1 cycle. Since 2 arealready used by the sub-pixel translation of the texture, there are notenough remaining for a 1 cycle average time.

[1482] The average time for processing 1 pixel's texture is therefore 2cycles. Note that there is no feedback, and hence the color channelorder of compositing is irrelevant.

[1483] With Feedback

[1484] This is conceptually the same as the case without feedback,except that in addition to the standard processing of the textureapplication algorithm, it is necessary to also record the proportion ofthe texture actually applied. The proportion can be used as a scalefactor for subsequent compositing of the tile's color onto thebackground image. A flow diagram is illustrated in FIG. 110 and thefollowing lookup table is used: Lookup Size Details LU₁ 256 entries 1/N16 bits per Table indexed by N (range 0-255) entry Resultant 16 bitstreated as fixed point 0:16

[1485] Each of the 256 entries in the software provided 1/N table 460 is16 bits, thus requiring 16 cache lines to hold continuously.

[1486] Sub-pixel translation 461 of a tile's texture can be accomplishedusing 2 Multiply ALUs and 2 Adder ALUs in an average time of 1 cycle peroutput pixel. Each Min 462 & Max 463 function requires a separate AdderALU in order to complete the entire operation in 1 cycle. Since 2 arealready used by the sub-pixel translation of the texture, there are notenough remaining for a 1 cycle average time.

[1487] The average time for processing 1 pixel's texture is therefore 2cycles. Sufficient space must be allocated for the feedback data area (atile sized image channel). The texture must be applied before the tile'scolor is applied, since the feedback is used in scaling the tile'sopacity.

[1488] CCD Image Interpolator

[1489] Images obtained from the CCD via the ISI 83 (FIG. 3) are 750×500pixels. When the image is captured via the ISI, the orientation of thecamera is used to rotate the pixels by 0, 90, 180, or 270 degrees sothat the top of the image corresponds to ‘up’. Since every pixel onlyhas an R, G, or B color component (rather than all 3), the fact thatthese have been rotated must be taken into account when interpreting thepixel values. Depending on the orientation of the camera, each 2×2 pixelblock has one of the configurations illustrated in FIG. 111:

[1490] Several processes need to be performed on the CCD captured imagein order to transform it into a useful form for processing:

[1491] Up-interpolation of low-sample rate color components in CCD image(interpreting correct orientation of pixels) Color conversion from RGBto the internal color space

[1492] Scaling of the internal space image from 750×500 to 1500×1000.

[1493] Writing out the image in a planar format

[1494] The entire channel of an image is required to be available at thesame time in order to allow warping. In a low memory model (8 MB), thereis only enough space to hold a single channel at full resolution as atemporary object. Thus the color conversion is to a single colorchannel. The limiting factor on the process is the color conversion, asit involves tri-linear interpolation from RGB to the internal colorspace, a process that takes 0.026 ns per channel (750×500×7 cycles perpixel×10 ns per cycle=26,250,000 ns).

[1495] It is important to perform the color conversion before scaling ofthe internal color space image as this reduces the number of pixelsscaled (and hence the overall process time) by a factor of 4.

[1496] The requirements for all of the transformations may not fit inthe ALU scheme. The transformations are therefore broken into twophases:

[1497] Phase 1: Up-interpolation of low-sample rate color components inCCD image (interpreting correct orientation of pixels)

[1498] Color conversion from RGB to the internal color space

[1499] Writing out the image in a planar format

[1500] Phase 2: Scaling of the internal space image from 750×500 to1500×1000

[1501] Separating out the scale function implies that the small colorconverted image must be in memory at the same time as the large one. Theoutput from Phase 1 (0.5 MB) can be safely written to the memory areausually kept for the image pyramid (1 MB). The output from Phase 2 canbe the general expanded CCD image. Separation of the scaling also allowsthe scaling to be accomplished by the Affine Transform, and also allowsfor a different CCD resolution that may not be a simple 1:2 expansion.

[1502] Phase 1: Up-interpolation of low-sample rate color components.

[1503] Each of the 3 color components (R, G, and B) needs to be upinterpolated in order for color conversion to take place for a givenpixel. We have 7 cycles to perform the interpolation per pixel since thecolor conversion takes 7 cycles.

[1504] Interpolation of G is straightforward and is illustrated in FIG.112. Depending on orientation, the actual pixel value G alternatesbetween odd pixels on odd lines & even pixels on even lines, and oddpixels on even lines & even pixels on odd lines. In both cases, linearinterpolation is all that is required. Interpolation of R and Bcomponents as illustrated in FIG. 113 and FIG. 113, is more complicated,since in the horizontal and vertical directions, as can be seen from thediagrams, access to 3 rows of pixels simultaneously is required, so 3Sequential Read Iterators are required, each one offset by a single row.In addition, we have access to the previous pixel on the same row via alatch for each row.

[1505] Each pixel therefore contains one component from the CCD, and theother 2 up-interpolated. When one component is being bi-linearlyinterpolated, the other is being linearly interpolated. Since theinterpolation factor is a constant 0.5, interpolation can be calculatedby an add and a shift 1 bit right (in 1 cycle), and bi-linearinterpolation of factor 0.5 can be calculated by 3 adds and a shift 2bits right (3 cycles). The total number of cycles required is therefore4, using a single multiply ALU.

[1506]FIG. 115 illustrates the case for rotation 0 even line even pixel(EL, EP), and odd line odd pixel (OL, OP) and FIG. 116 illustrates thecase for rotation 0 even line odd pixel (EL, OP), and odd line evenpixel (OL, EP). The other rotations are simply different forms of thesetwo expressions.

[1507] Color Conversion

[1508] Color space conversion from RGB to Lab is achieved using the samemethod as that described in the general Color Space Convert function, aprocess that takes 8 cycles per pixel. Phase 1 processing can bedescribed with reference to FIG. 117.

[1509] The up-interpolate of the RGB takes 4 cycles (1 Multiply ALU),but the conversion of the color space takes 8 cycles per pixel (2Multiply ALUs) due to the lookup transfer time.

[1510] Phase 2

[1511] Scaling the Image

[1512] This phase is concerned with up-interpolating the image from theCCD resolution (750×500) to the working photo resolution (1500×1000).Scaling is accomplished by running the Affine transform with a scale of1:2. The timing of a general affine transform is 2 cycles per outputpixel, which in this case means an elapsed scaling time of 0.03 seconds.

[1513] Illuminate Image

[1514] Once an image has been processed, it can be illuminated by one ormore light sources. Light sources can be:

[1515] 1. Directional—is infinitely distant so it casts parallel lightin a single direction

[1516] 2. Omni—casts unfocused lights in all directions.

[1517] 3. Spot—casts a focused beam of light at a specific target point.There is a cone and penumbra associated with a spotlight.

[1518] The scene may also have an associated bump-map to causereflection angles to vary. Ambient light is also optionally present inan illuminated scene.

[1519] In the process of accelerated illumination, we are concerned withilluminating one image channel by a single light source. Multiple lightsources can be applied to a single image channel as multiple passes onepass per light source. Multiple channels can be processed one at a timewith or without a bump-map.

[1520] The normal surface vector (N) at a pixel is computed from thebump-map if present. The default normal vector, in the absence of abump-map, is perpendicular to the image plane i.e. N=[0, 0, 1].

[1521] The viewing vector V is always perpendicular to the image planei.e. V=[0, 0, 1].

[1522] For a directional light source, the light source vector (L) froma pixel to the light source is constant across the entire image, so iscomputed once for the entire image. For an omni light source (at afinite distance), the light source vector is computed independently foreach pixel.

[1523] A pixel's reflection of ambient light is computed according to:I_(a)k_(a)O_(d)

[1524] A pixel's diffuse and specular reflection of a light source iscomputed according to the Phong model:

f _(att) I _(p) [k _(d) O _(d)(N·L)+k _(s) O _(s)(R·V)^(n)]

[1525] When the light source is at infinity, the light source intensityis constant across the image.

[1526] Each light source has three contributions per pixel

[1527] Ambient Contribution

[1528] Diffuse contribution

[1529] Specular contribution

[1530] The light source can be defined using the following variables:d_(L) Distance from light source f_(att) Attenuation with distance[f_(att) = 1 / d_(L) ²] R Normalised reflection vector [R = 2N(N · L) −L] I_(a) Ambient light intensity I_(p) Diffuse light coefficient k_(a)Ambient reflection coefficient k_(d) Diffuse reflection coefficientk_(s) Specular reflection coefficient k_(sc) Specular color coefficientL Normalised light source vector N Normalised surface normal vector nSpecular exponent O_(d) Object's diffuse color (i.e. image pixel color)O_(s) Object's specular color (k_(sc)O_(d) + (1 − k_(sc))I_(p)) VNormalised viewing vector [V = [0, 0, 1]]

[1531] The same reflection coefficients (k_(a), k_(s), k_(d)) are usedfor each color component.

[1532] A given pixel's value will be equal to the ambient contributionplus the sum of each light's diffuse and specular contribution.

[1533] Sub-Processes of Illumination Calculation

[1534] In order to calculate diffuse and specular contributions, avariety of other calculations are required. These are calculations of:

[1535] 1/{square root}X

[1536] N

[1537] L

[1538] N·L

[1539] R·V

[1540] f_(att)

[1541] f_(cp)

[1542] Sub-processes are also defined for calculating the contributionsof:

[1543] ambient

[1544] diffuse

[1545] specular

[1546] The sub-processes can then be used to calculate the overallillumination of a light source. Since there are only 4 multiply ALUs,the microcode for a particular type of light source can havesub-processes intermingled appropriately for performance.

[1547] Calculation of 1/{square root}X

[1548] The Vark lighting model uses vectors. In many cases it isimportant to calculate the inverse of the length of the vector fornormalization purposes. Calculating the inverse of the length requiresthe calculation of 1/SquareRoot [X].

[1549] Logically, the process can be represented as a process withinputs and outputs as shown in FIG. 118. Referring to FIG. 119, thecalculation can be made via a lookup of the estimation, followed by asingle iteration of the following function:

V _(n+1)=½V _(n)(3−XV _(n) ²)

[1550] The number of iterations depends on the accuracy required. Inthis case only 16 bits of precision are required. The table cantherefore have 8 bits of precision, and only a single iteration isnecessary. The following constant is set by software: Constant Value K₁3 The following lookup table is used: Lookup Size Details LU₁ 256entries 1/SquareRoot [X] 8 bits per Table indexed by the 8 highestsignificant entry bits of X. Resultant 8 bits treated as fixed point 0:8

[1551] Calculation of N

[1552] N is the surface normal vector. When there is no bump-map, N isconstant. When a bump-map is present, N must be calculated for eachpixel.

[1553] No Bump-Map

[1554] When there is no bump-map, there is a fixed normal N that has thefollowing properties:

N=[X _(N) , Y _(N) , Z _(N)]=[0, 0, 1]

∥N∥=1

1/∥N∥=1

normalized N=N

[1555] These properties can be used instead of specifically calculatingthe normal vector and 1/∥N∥ and thus optimize other calculations.

[1556] With Bump-Map

[1557] As illustrated in FIG. 120, when a bump-map is present, N iscalculated by comparing bump-map values in X and Y dimensions. FIG. 120shows the calculation of N for pixel P1 in terms of the pixels in thesame row and column, but not including the value at P1 itself. Thecalculation of N is made resolution independent by multiplying by ascale factor (same scale factor in X & Y). This process can berepresented as a process having inputs and outputs (Z_(N) is always 1)as illustrated in FIG. 121.

[1558] As Z_(N) is always 1. Consequently X_(N) and Y_(N) are notnormalized yet (since Z_(N)=1). Normalization of N is delayed untilafter calculation of N.L so that there is only 1 multiply by 1/∥N∥instead of 3.

[1559] An actual process for calculating N is illustrated in FIG. 122.The following constant is set by software: Constant Value K₁ ScaleFactor(to make N resolution independent)

[1560] Calculation of L

[1561] Directional Lights

[1562] When a light source is infinitely distant, it has an effectiveconstant light vector L. L is normalized and calculated by software suchthat:

L=[X _(L) , Y _(L) , Z _(L)]

∥L∥=1

1/∥L∥=1

[1563] These properties can be used instead of specifically calculatingthe L and 1/∥L∥ and thus optimize other calculations. This process is asillustrated in FIG. 123.

[1564] Omni Lights and Spotlights

[1565] When the light source is not infinitely distant, L is the vectorfrom the current point P to the light source PL. Since P=[X_(p), Y_(p),0], L is given by:

L=[X _(L) , Y _(L) , Z _(L)]

X _(L) =X _(P) −X _(PL)

Y _(L) =Y _(P) −Y _(PL)

Z _(L) =−Z _(PL)

[1566] We normalize X_(L), Y_(L) and Z_(L) by multiplying each by 1/∥L∥.The calculation of 1/∥L∥ (for later use in normalizing) is accomplishedby calculating

V=X _(L) ² +Y _(L) ² +Z _(L) ²

[1567] and then calculating V^(−1/2)

[1568] In this case, the calculation of L can be represented as aprocess with the inputs and outputs as indicated in FIG. 124.

[1569] X_(P) and Y_(P) are the coordinates of the pixel whoseillumination is being calculated. Z_(P) is always 0.

[1570] The actual process for calculating L can be as set out in FIG.125. Where the following constants are set by software: Constant ValueK₁ X_(PL) K₂ Y_(PL) K₃ Z_(PL) ² (as Z_(P) is 0) K₄ −Z_(PL)

[1571] Calculation of N.L

[1572] Calculating the dot product of vectors N and L is defined as:

X _(N) X _(L) +Y _(N) Y _(L) +Z _(N) Z _(L)

[1573] No Bump-Map

[1574] When there is no bump-map N is a constant [0, 0, 1]. N.Ltherefore reduces to Z_(L).

[1575] With Bump-Map

[1576] When there is a bump-map, we must calculate the dot productdirectly. Rather than take in normalized N components, we normalizeafter taking the dot product of a non-normalized N to a normalized L. Lis either normalized by software (if it is constant), or by theCalculate L process. This process is as illustrated in FIG. 126.

[1577] Note that Z_(N) is not required as input since it is defined tobe 1. However 1/∥N∥ is required instead, in order to normalize theresult. One actual process for calculating N.L is as illustrated in FIG.127.

[1578] Calculation of R·V

[1579] R·V is required as input to specular contribution calculations.Since V=[0, 0, 1], only the Z components are required. R·V thereforereduces to:

R·V=2Z _(N)(N.L)−Z _(L)

[1580] In addition, since the un-normalized Z_(N)=1, normalizedZ_(N)=1/∥N∥

[1581] No Bump-Map

[1582] The simplest implementation is when N is constant (i.e. nobump-map). Since N and V are constant, N.L and R·V can be simplified:

[1583] V=[0, 0, 1]

[1584] N=[0, 0, 1]

[1585] L=[X_(L), Y_(L), Z_(L)]

[1586] N.L=Z_(L)

[1587] R·V=2Z_(N)(N.L)−Z_(L)

[1588] =2Z_(L)-Z_(L)

[1589] =Z_(L)

[1590] When L is constant (Directional light source), a normalized Z_(L)can be supplied by software in the form of a constant whenever R·V isrequired. When L varies (Omni lights and Spotlights), normalized Z_(L)must be calculated on the fly. It is obtained as output from theCalculate L process.

[1591] With Bump-Map

[1592] When N is not constant, the process of calculating R·V is simplyan implementation of the generalized formula:

R·V=2Z _(N)(N.L)−Z _(L)

[1593] The inputs and outputs are as shown in FIG. 128 with the anactual implementation as shown in FIG. 129.

[1594] Calculation of Attenuation Factor

[1595] Directional Lights

[1596] When a light source is infinitely distant, the intensity of thelight does not vary across the image. The attenuation factor fatt istherefore 1. This constant can be used to optimize illuminationcalculations for infinitely distant light sources.

[1597] Omni Lights and Spotlights

[1598] When a light source is not infinitely distant, the intensity ofthe light can vary according to the following formula:

f _(att) =f ₀ +f ₁ /d+f ₂ /d ²

[1599] Appropriate settings of coefficients f₀, f₁, and f₂ allow lightintensity to be attenuated by a constant, linearly with distance, or bythe square of the distance.

[1600] Since d=∥L∥, the calculation of f_(att) can be represented as aprocess with the following inputs and outputs as illustrated in FIG.130.

[1601] The actual process for calculating f_(att) can be defined in FIG.131.

[1602] Where the following constants are set by software: Constant ValueK₁ F₂ K₂ f₁ K₃ F₀

[1603] Calculation of Cone and Penumbra Factor

[1604] Directional Lights and Omni Lights

[1605] These two light sources are not focused, and therefore have nocone or penumbra. The cone-penumbra scaling factor f_(cp) istherefore 1. This constant can be used to optimize illuminationcalculations for Directional and Omni light sources.

[1606] Spotlights

[1607] A spotlight focuses on a particular target point (PT). Theintensity of the Spotlight varies according to whether the particularpoint of the image is in the cone, in the penumbra, or outside thecone/penumbra region.

[1608] Turning now to FIG. 132, there is illustrated a graph of f_(cp)with respect to the penumbra position. Inside the cone 470, f_(cp) is 1,outside 471 the penumbra f_(cp) is 0. From the edge of the cone throughto the end of the penumbra, the light intensity varies according to acubic function 472.

[1609] The various vectors for penumbra 475 and cone 476 calculation areas illustrated in FIG. 133 and FIG. 134.

[1610] Looking at the surface of the image in 1 dimension as shown inFIG. 134, 3 angles A, B, and C are defined. A is the angle between thetarget point 479, the light source 478, and the end of the cone 480. Cis the angle between the target point 479, light source 478, and the endof the penumbra 481. Both are fixed for a given light source. B is theangle between the target point 479, the light source 478, and theposition being calculated 482, and therefore changes with every pointbeing calculated on the image.

[1611] We normalize the range A to C to be 0 to 1, and find the distancethat B is along that angle range by the formula:

(B−A)/(C−A)

[1612] The range is forced to be in the range 0 to 1 by truncation, andthis value used as a lookup for the cubic approximation of f_(cp).

[1613] The calculation of f_(att) can therefore be represented as aprocess with the inputs and outputs as illustrated in FIG. 135 with anactual process for calculating f_(cp) is as shown in FIG. 136 where thefollowing constants are set by software: Constant Value K₁ X_(LT) K₂Y_(LT) K₃ Z_(LT) K₄ A K₅ 1/(C − A). [MAXNUM if no penumbra]

[1614] The following lookup tables are used: Lookup Size Details LU₁ 64entries Arcos(X) 16 bits per Units are same as for constants K₅ and K₆entry Table indexed by highest 6 bits Result by linear interpolation of2 entries Timing is 2 * 8 bits * 2 entries = 4 cycles LU₂ 64 entriesLight Response function f_(cp) 16 bits per F(1) = 0, F(0) = 1, othersare according entry to cubic Table indexed by 6 bits (1:5) Result bylinear interpolation of 2 entries Timing is 2 * 8 bits = 4 cycles

[1615] Calculation of Ambient Contribution

[1616] Regardless of the number of lights being applied to an image, theambient light contribution is performed once for each pixel, and doesnot depend on the bump-map.

[1617] The ambient calculation process can be represented as a processwith the inputs and outputs as illustrated in FIG. 131. Theimplementation of the process requires multiplying each pixel from theinput image (O_(d)) by a constant value (I_(a)k_(a)), as shown in FIG.138 where the following constant is set by software: Constant Value K₁I_(a)k_(a)

[1618] Calculation of Diffuse Contribution

[1619] Each light that is applied to a surface produces a diffuseillumination. The diffuse illumination is given by the formula:

diffuse=k _(d) O _(d)(N.L)

[1620] There are 2 different implementations to consider:

[1621] Implementation 1—Constant N and L

[1622] When N and L are both constant (Directional light and nobump-map):

N.L=Z _(L)

[1623] Therefore:

diffuse=k _(d) O _(d) Z _(L)

[1624] Since O_(d) is the only variable, the actual process forcalculating the diffuse contribution is as illustrated in FIG. 139 wherethe following constant is set by software: Constant Value K₁ k_(d)(N ·L) = k_(d)Z_(L)

[1625] Implementation 2—Non-Constant N & L

[1626] When either N or L are non-constant (either a bump-map orillumination from an Omni light or a Spotlight), the diffuse calculationis performed directly according to the formula:

diffuse=k _(d) O _(d)(N.L)

[1627] The diffuse calculation process can be represented as a processwith the inputs as illustrated in FIG. 140. N.L can either be calculatedusing the Calculate N.L Process, or is provided as a constant. An actualprocess for calculating the diffuse contribution is as shown in FIG. 141where the following constants are set by software: Constant Value K₁k_(d)

[1628] Calculation of Specular Contribution

[1629] Each light that is applied to a surface produces a specularillumination. The specular illumination is given by the formula:

specular=k _(s) O _(s)(R·V)^(n)

[1630] where O_(s)=k_(sc)O_(d)+(1−k_(sc))I_(p)

[1631] There are two implementations of the Calculate Specular process.

[1632] Implementation 1—Constant N and L

[1633] The first implementation is when both N and L are constant(Directional light and no bump-map). Since N, L and V are constant, N.Land R·V are also constant:

V=[0, 0, 1]

N=[0, 0, 1]

L=[X _(L) , Y _(L) , Z _(L)]

N.L=Z _(L)

[1634] $\begin{matrix}{{R \cdot V} = {{2{Z_{N}\left( {N \cdot L} \right)}} - Z_{L}}} \\{= {{2Z_{L}} - Z_{L}}} \\{= Z_{L}}\end{matrix}$

[1635] The specular calculation can thus be reduced to: $\begin{matrix}{{specular} = {k_{s}O_{s}\quad Z_{L}^{\quad n}}} \\{= {k_{s}{Z_{L}^{n}\left( {{k_{sc}O_{d}} + {\left( {1 - k_{sc}} \right)I_{p}}} \right)}}} \\{= {{k_{s}k_{sc}Z_{L}^{n}O_{d}} + {\left( {1 - k_{sc}} \right)I_{p}k_{s}Z_{L}^{n}}}}\end{matrix}$

[1636] Since only O_(d) is a variable in the specular calculation, thecalculation of the specular contribution can therefore be represented asa process with the inputs and outputs as indicated in FIG. 142 and anactual process for calculating the specular contribution is illustratedin FIG. 143 where the following constants are set by software: ConstantValue K₁ k_(s)k_(sc)Z_(L) ^(n) K₂ (1 − k_(sc))I_(p)k_(s)Z_(L) ^(n)

[1637] Implementation 2—Non Constant N and L

[1638] This implementation is when either N or L are not constant(either a bump-map or illumination from an Omni light or a Spotlight).This implies that R·V must be supplied, and hence R·V^(n) must also becalculated.

[1639] The specular calculation process can be represented as a processwith the inputs and outputs as shown in FIG. 144. FIG. 145 shows anactual process for calculating the specular contribution where thefollowing constants are set by software: Constant Value K₁ k_(s) K₂k_(sc) K₃ (1 − k_(sc))I_(p)

[1640] The following lookup table is used: Lookup Size Details LU₁ 32X^(n) entries Table indexed by 5 highest bits of integer R · V 16 bitsResult by linear interpolation of 2 entries per using fraction of R · V.Interpolation by 2 entry Multiplies. The time taken to retrieve the datafrom the lookup is 2 * 8 bits * 2 entries = 4 cycles.

[1641] When Ambient Light is the Only Illumination

[1642] If the ambient contribution is the only light source, the processis very straightforward since it is not necessary to add the ambientlight to anything with the overall process being as illustrated in FIG.146. We can divide the image vertically into 2 sections, and processeach half simultaneously by duplicating the ambient light logic (thususing a total of 2 Multiply ALUs and 4 Sequential Iterators). The timingis therefore ½ cycle per pixel for ambient light application.

[1643] The typical illumination case is a scene lit by one or morelights. In these cases, because ambient light calculation is so cheap,the ambient calculation is included with the processing of each lightsource. The first light to be processed should have the correctI_(a)k_(a) setting, and subsequent lights should have an I_(a)k_(a)value of 0 (to prevent multiple ambient contributions).

[1644] If the ambient light is processed as a separate pass (and not thefirst pass), it is necessary to add the ambient light to the currentcalculated value (requiring a read and write to the same address). Theprocess overview is shown in FIG. 147.

[1645] The process uses 3 Image Iterators, 1 Multiply ALU, and takes 1cycle per pixel on average.

[1646] Infinite Light Source

[1647] In the case of the infinite light source, we have a constantlight source intensity across the image. Thus both L and f_(att) areconstant.

[1648] No Bump Map

[1649] When there is no bump-map, there is a constant normal vector N[0, 0, 1]. The complexity of the illumination is greatly reduced by theconstants of N, L, and f_(att). The process of applying a singleDirectional light with no bump-map is as illustrated in FIG. 147 wherethe following constant is set by software: Constant Value K₁ I_(p)

[1650] For a single infinite light source we want to perform the logicaloperations as shown in FIG. 148 where K₁ through K₄ are constants withthe following values: Constant Value K₁ K_(d)(NsL) = K_(d) L_(Z) K₂k_(sc) K₃ K_(s)(NsH)^(n) = K_(s) H_(Z) ² K₄ I_(p)

[1651] The process can be simplified since K₂, K₃, and K₄ are constants.Since the complexity is essentially in the calculation of the specularand diffuse contributions (using 3 of the Multiply ALUs), it is possibleto safely add an ambient calculation as the 4^(th) Multiply ALU. Thefirst infinite light source being processed can have the true ambientlight parameter I_(a)k_(a), and all subsequent infinite lights can setI_(a)k_(a) to be 0. The ambient light calculation becomes effectivelyfree.

[1652] If the infinite light source is the first light being applied,there is no need to include the existing contributions made by otherlight sources and the situation is as illustrated in FIG. 149 where theconstants have the following values: Constant Value K₁ k_(d)(LsN) =k_(d)L_(Z) K₄ I_(p) K₅ (1 − k_(s)(NsH)^(n))I_(p) = (1 − k_(s)H_(Z)^(n))I_(p) K₆ k_(sc)k_(s)(NsH)^(n) I_(p) = k_(sc)k_(s)H_(Z) ^(n)I_(p) K₇I_(a)k_(a)

[1653] If the infinite light source is not the first light beingapplied, the existing contribution made by previously processed lightsmust be included (the same constants apply) and the situation is asillustrated in FIG. 148.

[1654] In the first case 2 Sequential Iterators 490, 491 are required,and in the second case, 3 Sequential Iterators 490, 491, 492 (the extraIterator is required to read the previous light contributions). In bothcases, the application of an infinite light source with no bump maptakes 1 cycle per pixel, including optional application of the ambientlight.

[1655] With Bump Map

[1656] When there is a bump-map, the normal vector N must be calculatedper pixel and applied to the constant light source vector L. 1/∥N∥ isalso used to calculate R·V, which is required as input to the CalculateSpecular 2 process. The following constants are set by software:Constant Value K₁ X_(L) K₂ Y_(L) K₃ Z_(L) K₄ I_(p)

[1657] Bump-map Sequential Read Iterator 490 is responsible for readingthe current line of the bump-map. It provides the input for determiningthe slope in X. Bump-map Sequential Read Iterators 491, 492 and areresponsible for reading the line above and below the current line. Theyprovide the input for determining the slope in Y.

[1658] Omni Lights

[1659] In the case of the Omni light source, the lighting vector L andattenuation factor f_(att) change for each pixel across an image.Therefore both L and f_(att) must be calculated for each pixel.

[1660] No Bump Map

[1661] When there is no bump-map, there is a constant normal vector N[0, 0, 1]. Although L must be calculated for each pixel, both N.L andR·V are simplified to Z_(L). When there is no bump-map, the applicationof an Omni light can be calculated as shown in FIG. 149 where thefollowing constants are set by software: Constant Value K₁ X_(P) K₂Y_(P) K₃ I_(p)

[1662] The algorithm optionally includes the contributions from previouslight sources, and also includes an ambient light calculation. Ambientlight needs only to be included once. For all other light passes, theappropriate constant in the Calculate Ambient process should be set to0.

[1663] The algorithm as shown requires a total of 19multiply/accumulates. The times taken for the lookups are 1 cycle duringthe calculation of L, and 4 cycles during the specular contribution. Theprocessing time of 5 cycles is therefore the best that can beaccomplished. The time taken is increased to 6 cycles in case it is notpossible to optimally microcode the ALUs for the function. The speed forapplying an Omni light onto an image with no associated bump-map is 6cycles per pixel.

[1664] With Bump-Map

[1665] When an Omni light is applied to an image with an associated abump-map, calculation of N, L, N.L and R·V are all necessary. Theprocess of applying an Omni light onto an image with an associatedbump-map is as indicated in FIG. 150 where the following constants areset by software: Constant Value K₁ X_(P) K₂ Y_(P) K₃ I_(p)

[1666] The algorithm optionally includes the contributions from previouslight sources, and also includes an ambient light calculation. Ambientlight needs only to be included once. For all other light passes, theappropriate constant in the Calculate Ambient process should be set to0.

[1667] The algorithm as shown requires a total of 32multiply/accumulates. The times taken for the lookups are 1 cycle eachduring the calculation of both L and N, and 4 cycles for the specularcontribution. However the lookup required for N and L are both the same(thus 2 LUs implement the 3 LUs). The processing time of 8 cycles isadequate. The time taken is extended to 9 cycles in case it is notpossible to optimally microcode the ALUs for the function. The speed forapplying an Omni light onto an image with an associated bump-map is 9cycles per pixel.

[1668] Spotlights

[1669] Spotlights are similar to Omni lights except that the attenuationfactor f_(att) is modified by a cone/penumbra factor f_(cp) thateffectively focuses the light around a target.

[1670] No Bump-Map

[1671] When there is no bump-map, there is a constant normal vector N[0, 0, 1]. Although L must be calculated for each pixel, both N.L andR·V are simplified to Z_(L). FIG. 151 illustrates the application of aSpotlight to an image where the following constants are set by software:Constant Value K₁ X_(P) K₂ Y_(P) K₃ I_(p)

[1672] The algorithm optionally includes the contributions from previouslight sources, and also includes an ambient light calculation. Ambientlight needs only to be included once. For all other light passes, theappropriate constant in the Calculate Ambient process should be set to0.

[1673] The algorithm as shown requires a total of 30multiply/accumulates. The times taken for the lookups are 1 cycle duringthe calculation of L, 4 cycles for the specular contribution, and 2 setsof 4 cycle lookups in the cone/penumbra calculation.

[1674] With Bump-Map

[1675] When a Spotlight is applied to an image with an associated abump-map, calculation of N, L, N.L and R·V are all necessary. Theprocess of applying a single Spotlight onto an image with associatedbump-map is illustrated in FIG. 152 where the following constants areset by software:

[1676] The algorithm optionally includes the contributions from previouslight sources, and also includes an ambient light calculation. Ambientlight needs only to be included once. For all other light passes, theappropriate constant in the Calculate Ambient process should be set to0. The algorithm as shown requires a total of 41 multiply/accumulates.

[1677] Print Head 44

[1678]FIG. 153 illustrates the logical layout of a single print Headwhich logically consists of 8 segments, each printing bi-level cyan,magenta, and yellow onto a portion of the page.

[1679] Loading a Segment for Printing

[1680] Before anything can be printed, each of the 8 segments in thePrint Head must be loaded with 6 rows of data corresponding to thefollowing relative rows in the final output image:

[1681] Row 0=Line N, Yellow, even dots 0, 2, 4, 6, 8, . . .

[1682] Row 1=Line N+8, Yellow, odd dots 1, 3, 5, 7, . . .

[1683] Row 2=Line N+10, Magenta, even dots 0, 2, 4, 6, 8, . . .

[1684] Row 3=Line N+18, Magenta, odd dots 1, 3, 5, 7, . . .

[1685] Row 4=Line N+20, Cyan, even dots 0, 2, 4, 6, 8, . . .

[1686] Row 5=Line N+28, Cyan, odd dots 1, 3, 5, 7, . . .

[1687] Each of the segments prints dots over different parts of thepage. Each segment prints 750 dots of one color, 375 even dots on onerow, and 375 odd dots on nother. The 8 segments have dots correspondingto positions: Segment First dot Last dot 0 0 749 1 750 1499 2 1500 22493 2250 2999 4 3000 3749 5 3750 4499 6 4500 5249 7 5250 5999

[1688] Each dot is represented in the Print Head segment by a singlebit. The data must be loaded 1 bit at a time by placing the data on thesegment's BitValue pin, and clocked in to a shift register in thesegment according to a BitClock. Since the data is loaded into a shiftregister, the order of Loading bits must be correct. Data can be clockedin to the Print Head at a maximum rate of 10 MHz.

[1689] Once all the bits have been loaded, they must be transferred inparallel to the Print Head output buffer, ready for printing. Thetransfer is accomplished by a single pulse on the segment'sParallelXferClock pin.

[1690] Controlling the Print

[1691] In order to conserve power, not all the dots of the Print Headhave to be printed simultaneously. A set of control lines enables theprinting of specific dots. An external controller, such as the ACP, canchange the number of dots printed at once, as well as the duration ofthe print pulse in accordance with speed and/or power requirements.

[1692] Each segment has 5 NozzleSelect lines, which are decoded toselect 32 sets of nozzles per row. Since each row has 375 nozzles, eachset contains 12 nozzles. There are also 2 BankEnable lines, one for eachof the odd and even rows of color. Finally, each segment has 3ColorEnable lines, one for each of C, M, and Y colors. A pulse on one ofthe ColorEnable lines causes the specified nozzles of the color'sspecified rows to be printed. A pulse is typically about 2□s induration.

[1693] If all the segments are controlled by the same set ofNozzleSelect, BankEnable and ColorEnable lines (wired externally to theprint head), the following is true:

[1694] If both odd and even banks print simultaneously (both BankEnablebits are set), 24 nozzles fire simultaneously per segment, 192 nozzlesin all, consuming 5.7 Watts.

[1695] If od and even banks print independently, only 12 nozzles firesimultaneously per segment, 96 in all, consuming 2.85 Watts.

[1696] Print Head Interface 62

[1697] The Print Head Interface 62 connects the ACP to the Print Head,providing both data and appropriate signals to the external Print Head.The Print Head Interface 62 works in conjunction with both a VLIWprocessor 74 and a software algorithm running on the CPU in order toprint a photo in approximately 2 seconds.

[1698] An overview of the inputs and outputs to the Print Head Interfaceis shown in FIG. 154. The Address and Data Buses are used by the CPU toaddress the various registers in the Print Head Interface. A singleBitClock output line connects to all 8 segments on the print head. The 8DataBits lines lead one to each segment, and are clocked in to the 8segments on the print head simultaneously (on a BitClock pulse). Forexample, dot 0 is transferred to segment₀, dot 750 is transferred tosegment₁, dot 1500 to segment₂ etc. simultaneously.

[1699] The VLIW Output FIFO contains the dithered bi-level C, M, and Y6000×9000 resolution print image in the correct order for output to the8 DataBits. The ParallelXferClock is connected to each of the 8 segmentson the print head, so that on a single pulse, all segments transfertheir bits at the same time. Finally, the NozzleSelect, BankEnable andColorEnable lines are connected to each of the 8 segments, allowing thePrint Head Interface to control the duration of the C, M, and Y droppulses as well as how many drops are printed with each pulse. Registersin the Print Head Interface allow the specification of pulse durationsbetween 0 and 6 □s, with a typical duration of 2□s.

[1700] Printing an Image

[1701] There are 2 phases that must occur before an image is in the handof the Artcam user:

[1702] 1. Preparation of the image to be printed

[1703] 2. Printing the prepared image Preparation of an image only needsto be performed once. Printing the image can be performed as many timesas desired.

[1704] Prepare the Image

[1705] Preparing an image for printing involves:

[1706] 1. Convert the Photo Image into a Print Image

[1707] 2. Rotation of the Print Image (internal color space) to alignthe output for the orientation of the printer

[1708] 3. Up-interpolation of compressed channels (if necessary)

[1709] 4. Color conversion from the internal color space to the CMYcolor space appropriate to the specific printer and ink

[1710] At the end of image preparation, a 4.5 MB correctly oriented1000×1500 CMY image is ready to be printed.

[1711] Convert Photo Image to Print Image

[1712] The conversion of a Photo Image into a Print Image requires theexecution of a Vark script to perform image processing. The script iseither a default image enhancement script or a Vark script taken fromthe currently inserted Artcard. The Vark script is executed via the CPU,accelerated by functions performed by the VLIW Vector Processor.

[1713] Rotate the Print Image

[1714] The image in memory is originally oriented to be top upwards.This allows for straightforward Vark processing. Before the image isprinted, it must be aligned with the print roll's orientation. There-alignment only needs to be done once. Subsequent Prints of a PrintImage will already have been rotated appropriately.

[1715] The transformation to be applied is simply the inverse of thatapplied during capture from the CCD when the user pressed the “ImageCapture” button on the Artcam. If the original rotation was 0, then notransformation needs to take place. If the original rotation was +90degrees, then the rotation before printing needs to be −90 degrees (sameas 270 degrees). The method used to apply the rotation is the Varkaccelerated Affine Transform function. The Affine Transform engine canbe called to rotate each color channel independently. Note that thecolor channels cannot be rotated in place. Instead, they can make use ofthe space previously used for the expanded single channel (1.5 MB).

[1716]FIG. 155 shows an example of rotation of a Lab image where the aand b channels are compressed 4:1. The L channel is rotated into thespace no longer required (the single channel area), then the a channelcan be rotated into the space left vacant by L, and finally the bchannel can be rotated. The total time to rotate the 3 channels is 0.09seconds. It is an acceptable period of time to elapse before the firstprint image. Subsequent prints do not incur this overhead.

[1717] Up Interpolate and Color Convert

[1718] The Lab image must be converted to CMY before printing. Differentprocessing occurs depending on whether the a and b channels of the Labimage is compressed. If the Lab image is compressed, the a and bchannels must be decompressed before the color conversion occurs. If theLab image is not compressed, the color conversion is the only necessarystep. The Lab image must be up interpolated (if the a and b channels arecompressed) and converted into a CMY image. A single VLIW processcombining scale and color transform can be used.

[1719] The method used to perform the color conversion is the Varkaccelerated Color Convert function. The Affine Transform engine can becalled to rotate each color channel independently. The color channelscannot be rotated in place. Instead, they can make use of the spacepreviously used for the expanded single channel (1.5 MB).

[1720] Print the Image

[1721] Printing an image is concerned with taking a correctly oriented1000×1500 CMY image, and generating data and signals to be sent to theexternal Print Head. The process involves the CPU working in conjunctionwith a VLIW process and the Print Head Interface.

[1722] The resolution of the image in the Artcam is 1000×1500. Theprinted image has a resolution of 6000×9000 dots, which makes for a verystraightforward relationship: 1 pixel=6×6=36 dots. As shown in FIG. 156since each dot is 16.6□m, the 6×6 dot square is 100 □m square. Sinceeach of the dots is bi-level, the output must be dithered.

[1723] The image should be printed in approximately 2 seconds. For 9000rows of dots this implies a time of 222 □s time between printing eachrow. The Print Head Interface must generate the 6000 dots in this time,an average of 37 ns per dot. However, each dot comprises 3 colors, sothe Print Head Interface must generate each color component inapproximately 12 ns, or 1 clock cycle of the ACP (10 ns at 100 MHz). OneVLIW process is responsible for calculating the next line of 6000 dotsto be printed. The odd and even C, M, and Y dots are generated bydithering input from 6 different 1000×1500 CMY image lines. The secondVLIW process is responsible for taking the previously calculated line of6000 dots, and correctly generating the 8 bits of data for the 8segments to be transferred by the Print Head Interface to the Print Headin a single transfer.

[1724] A CPU process updates registers in the fist VLIW process 3 timesper print line (once per color component=27000 times in 2 seconds0, andin the 2nd VLIW process once every print line (9000 times in 2 seconds).The CPU works one line ahead of the VLIW process in order to do this.

[1725] Finally, the Print Head Interface takes the 8 bit data from theVLIW Output FIFO, and outputs it unchanged to the Print Head, producingthe BitClock signals appropriately. Once all the data has beentransferred a ParallelXferClock signal is generated to load the data forthe next print line. In conjunction with transferring the data to thePrint Head, a separate timer is generating the signals for the differentprint cycles of the Print Head using the NozzleSelect, ColorEnable, andBankEnable lines a specified by Print Head Interface internal registers.

[1726] The CPU also controls the various motors and guillotine via theparallel interface during the print process.

[1727] Generate C, M, and Y Dots

[1728] The input to this process is a 1000×1500 CMY image correctlyoriented for printing. The image is not compressed in any way. Asillustrated in FIG. 157, a VLIW microcode program takes the CMY image,and generates the C, M, and Y pixels required by the Print HeadInterface to be dithered.

[1729] The process is run 3 times, once for each of the 3 colorcomponents. The process consists of 2 sub-processes run in parallel—onefor producing even dots, and the other for producing odd dots. Eachsub-process takes one pixel from the input image, and produces 3 outputdots (since one pixel=6 output dots, and each sub-process is concernedwith either even or odd dots). Thus one output dot is generated eachcycle, but an input pixel is only read once every 3 cycles.

[1730] The original dither cell is a 64×64 cell, with each entry 8 bits.This original cell is divided into an odd cell and an even cell, so thateach is still 64 high, but only 32 entries wide. The even dither cellcontains original dither cell pixels 0, 2, 4 etc., while the oddcontains original dither cell pixels 1, 3, 5 etc. Since a dither cellrepeats across a line, a single 32 byte line of each of the 2 dithercells is required during an entire line, and can therefore be completelycached. The odd and even lines of a single process line are staggered 8dot lines apart, so it is convenient to rotate the odd dither cell'slines by 8 lines. Therefore the same offset into both odd and evendither cells can be used. Consequently the even dither cell's linecorresponds to the even entries of line L in the original dither cell,and the even dither cell's line corresponds to the odd entries of lineL+8 in the original dither cell.

[1731] The process is run 3 times, once for each of the colorcomponents. The CPU software routine must ensure that the SequentialRead Iterators for odd and even lines are pointing to the correct imagelines corresponding to the print heads. For example, to produce one setof 18,000 dots (3 sets of 6000 dots):

[1732] Yellow even dot line=0, therefore input Yellow image line=0/6=0

[1733] Yellow odd dot line=8, therefore input Yellow image line=8/6=1

[1734] Magenta even line=10, therefore input Magenta image line=10/6=1

[1735] Magenta odd line=18, therefore input Magenta image line=18/6=3

[1736] Cyan even line=20, therefore input Cyan image line=20/6=3

[1737] Cyan odd line=28, therefore input Cyan image line 28/6=4

[1738] Subsequent sets of input image lines are:

[1739] Y=[0, 1], M=[1, 3], C=[3, 4]

[1740] Y=[0, 1], M=[1, 3], C=[3, 4]

[1741] Y=[0, 1], M=[2, 3], C=[3, 5]

[1742] Y=[0, 1], M=[2, 3], C=[3, 5]

[1743] Y=[0, 2], M=[2, 3], C=[4, 5]

[1744] The dither cell data however, does not need to be updated foreach color component. The dither cell for the 3 colors becomes the same,but offset by 2 dot lines for each component.

[1745] The Dithered Output is written to a Sequential Write Iterator,with odd and even dithered dots written to 2 separate outputs. The sametwo Write Iterators are used for all 3 color components, so that theyare contiguous within the break-up of odd and even dots.

[1746] While one set of dots is being generated for a print line, thepreviously generated set of dots is being merged by a second VLIWprocess as described in the next section.

[1747] Generate Merged 8 bit Dot Output

[1748] This process, as illustrated in FIG. 158, takes a single line ofdithered dots and generates the 8 bit data stream for output to thePrint Head Interface via the VLIW Output FIFO. The process requires theentire line to have been prepared, since it requires semi-random accessto most of the dithered line at once. The following constant is set bysoftware: Constant Value K₁ 375

[1749] The Sequential Read Iterators point to the line of previouslygenerated dots, with the Iterator registers set up to limit access to asingle color component. The distance between subsequent pixels is 375,and the distance between one line and the next is given to be 1 byte.Consequently 8 entries are read for each “line”. A single “line”corresponds to the 8 bits to be loaded on the print head. The totalnumber of “lines” in the image is set to be 375. With at least 8 cachelines assigned to the Sequential Read Iterator, complete cache coherenceis maintained. Instead of counting the 8 bits, 8 Microcode steps countimplicitly.

[1750] The generation process first reads all the entries from the evendots, combining 8 entries into a single byte which is then output to theVLIW Output FIFO. Once all 3000 even dots have been read, the 3000 odddots are read and processed. A software routine must update the addressof the dots in the odd and even Sequential Read Iterators once per colorcomponent, which equates to 3 times per line. The two VLIW processesrequire all 8 ALUs and the VLIW Output FIFO. As long as the CPU is ableto update the registers as described in the two processes, the VLIWprocessor can generate the dithered image dots fast enough to keep upwith the printer.

[1751] Data Card Reader

[1752]FIG. 159, there is illustrated on form of card reader 500 whichallows for the insertion of Artcards 9 for reading. FIG. 158 shows anexploded perspective of the reader of FIG. 159. Cardreader isinterconnected to a computer system and includes a CCD reading mechanism35. The cardreader includes pinch rollers 506, 507 for pinching aninserted Artcard 9. One of the roller e.g. 506 is driven by an Artcardmotor 37 for the advancement of the card 9 between the two rollers 506and 507 at a uniformed speed. The Artcard 9 is passed over a series ofLED lights 512 which are encased within a clear plastic mould 514 havinga semi circular cross section. The cross section focuses the light fromthe LEDs eg 512 onto the surface of the card 9 as it passes by the LEDs512. From the surface it is reflected to a high resolution linear CCD 34which is constructed to a resolution of approximately 480 dip. Thesurface of the Artcard 9 is encoded to the level of approximately 1600dpi hence, the linear CCD 34 supersamples the Artcard surface with anapproximately three times multiplier. The Artcard 9 is further driven ata speed such that the linear CCD 34 is able to supersample in thedirection of Artcard movement at a rate of approximately 4800 readingsper inch. The scanned Artcard CCD data is forwarded from the Artcardreader to ACP 31 for processing. A sensor 49, which can comprise a lightsensor acts to detect of the presence of the card 13.

[1753] The CCD reader includes a bottom substrate 516, a top substrate514 which comprises a transparent molded plastic. In between the twosubstrates is inserted the linear CCD array 34 which comprises a thinlong linear CCD array constructed by means of semi-conductormanufacturing processes.

[1754] Turning to FIG. 160, there is illustrated a side perspectiveview, partly in section, of an example construction of the CCD readerunit. The series of LEDs eg. 512 are operated to emit light when a card9 is passing across the surface of the CCD reader 34. The emitted lightis transmitted through a portion of the top substrate 523. The substrateincludes a portion eg. 529 having a curved circumference so as to focuslight emitted from LED 512 to a point eg. 532 on the surface of the card9. The focused light is reflected from the point 532 towards the CCDarray 34. A series of microlenses eg. 534, shown in exaggerated form,are formed on the surface of the top substrate 523. The microlenses 523act to focus light received across the surface to the focused down to apoint 536 which corresponds to point on the surface of the CCD reader 34for sensing of light falling on the light sensing portion of the CCDarray 34.

[1755] A number of refinements of the above arrangement are possible.For example, the sensing devices on the linear CCD 34 may be staggered.The corresponding microlenses 34 can also be correspondingly formed asto focus light into a staggered series of spots so as to correspond tothe staggered CCD sensors.

[1756] To assist reading, the data surface area of the Artcard 9 ismodulated with a checkerboard pattern as previously discussed withreference to FIG. 38. Other forms of high frequency modulation may bepossible however.

[1757] It will be evident that an Artcard printer can be provided as forthe printing out of data on storage Artcard. Hence, the Artcard systemcan be utilized as a general form of information distribution outside ofthe Artcam device. An Artcard printer can prints out Artcards on highquality print surfaces and multiple Artcards can be printed on samesheets and later separated. On a second surface of the Artcard 9 can beprinted information relating to the files etc. stored on the Artcard 9for subsequent storage.

[1758] Hence, the Artcard system allows for a simplified form of storagewhich is suitable for use in place of other forms of storage such as CDROMs, magnetic disks etc. The Artcards 9 can also be mass produced andthereby produced in a substantially inexpensive form for redistribution.

[1759] Print Rolls

[1760] Turning to FIG. 162, there is illustrated the print roll 42 andprint-head portions of the Artcam. The paper/film 611 is fed in acontinuous “web-like” process to a printing mechanism 15 which includesfurther pinch rollers 616-619 and a print head 44

[1761] The pinch roller 613 is connected to a drive mechanism (notshown) and upon rotation of the print roller 613, “paper” in the form offilm 611 is forced through the printing mechanism 615 and out of thepicture output slot 6. A rotary guillotine mechanism (not shown) isutilised to cut the roll of paper 611 at required photo sizes.

[1762] It is therefore evident that the printer roll 42 is responsiblefor supplying “paper” 611 to the print mechanism 615 for printing ofphotographically imaged pictures.

[1763] In FIG. 163, there is shown an exploded perspective of the printroll 42. The printer roll 42 includes output printer paper 611 which isoutput under the operation of pinching rollers 612, 613.

[1764] Referring now to FIG. 164, there is illustrated a more fullyexploded perspective view, of the print roll 42 of FIG. 163 without the“paper” film roll. The print roll 42 includes three main partscomprising ink reservoir section 620, paper roll sections 622, 623 andouter casing sections 626, 627.

[1765] Turning first to the ink reservoir section 620, which includesthe ink reservoir or ink supply sections 633. The ink for printing iscontained within three bladder type containers 630-632. The printer roll42 is assumed to provide full color output inks. Hence, a first inkreservoir or bladder container 630 contains cyan colored ink. A secondreservoir 631 contains magenta colored ink and a third reservoir 632contains yellow ink. Each of the reservoirs 630-632, although havingdifferent volumetric dimensions, are designed to have substantially thesame volumetric size.

[1766] The ink reservoir sections 621, 633, in addition to cover 624 canbe made of plastic sections and are designed to be mated together bymeans of heat sealing, ultra violet radiation, etc. Each of the equallysized ink reservoirs 630-632 is connected to a corresponding ink channel639-641 for allowing the flow of ink from the reservoir 630-632 to acorresponding ink output port 635-637. The ink reservoir 632 having inkchannel 641, and output port 637, the ink reservoir 631 having inkchannel 640 and output port 636, and the ink reservoir 630 having inkchannel 639 and output port 637.

[1767] In operation, the ink reservoirs 630-632 can be filled withcorresponding ink and the section 633 joined to the section 621. The inkreservoir sections 630-632, being collapsible bladders, allow for ink totraverse ink channels 639-641 and therefore be in fluid communicationwith the ink output ports 635-637. Further, if required, an air inletport can also be provided to allow the pressure associated with inkchannel reservoirs 630-632 to be maintained as required.

[1768] The cap 624 can be joined to the ink reservoir section 620 so asto form a pressurized cavity, accessible by the air pressure inlet port.

[1769] The ink reservoir sections 621, 633 and 624 are designed to beconnected together as an integral unit and to be inserted inside printerroll sections 622, 623. The printer roll sections 622, 623 are designedto mate together by means of a snap fit by means of male portions645-647 mating with corresponding female portions (not shown).Similarly, female portions 654-656 are designed to mate withcorresponding male portions 660-662. The paper roll sections 622, 623are therefore designed to be snapped together. One end of the filmwithin the role is pinched between the two sections 622, 623 when theyare joined together. The print film can then be rolled on the print rollsections 622, 625 as required.

[1770] As noted previously, the ink reservoir sections 620, 621, 633,624 are designed to be inserted inside the paper roll sections 622, 623.The printer roll sections 622, 623 are able to be rotatable aroundstationery ink reservoir sections 621, 633 and 624 to dispense film ondemand.

[1771] The outer casing sections 626 and 627 are further designed to becoupled around the print roller sections 622, 623. In addition to eachend of pinch rollers eg 612, 613 is designed to clip in to acorresponding cavity eg 670 in cover 626, 627 with roller 613 beingdriven externally (not shown) to feed the print film and out of theprint roll.

[1772] Finally, a cavity 677 can be provided in the ink reservoirsections 620, 621 for the insertion and gluing of an silicon chipintegrated circuit type device 53 for the storage of informationassociated with the print roll 42.

[1773] As shown in FIG. 155 and FIG. 164, the print roll 42 is designedto be inserted into the Artcam camera device so as to couple with acoupling unit 680 which includes connector pads 681 for providing aconnection with the silicon chip 53. Further, the connector 680 includesend connectors of four connecting with ink supply ports 635-637. The inksupply ports are in turn to connect to ink supply lines eg 682 which arein turn interconnected to printheads supply ports eg. 687 for the flowof ink to print-head 44 in accordance with requirements.

[1774] The “media” 611 utilised to form the roll can comprise manydifferent materials on which it is designed to print suitable images.For example, opaque rollable plastic material may be utilized,transparencies may be used by using transparent plastic sheets, metallicprinting can take place via utilization of a metallic sheet film.Further, fabrics could be utilised within the printer roll 42 forprinting images on fabric, although care must be taken that only fabricshaving a suitable stiffness or suitable backing material are utilised.

[1775] When the print media is plastic, it can be coated with a layerwhich fixes and absorbs the ink. Further, several types of print mediamay be used, for example, opaque white matte, opaque white gloss,transparent film, frosted transparent film, lenticular array film forstereoscopic 3D prints, metallised film, film with the embossed opticalvariable devices such as gratings or holograms, media which ispre-printed on the reverse side, and media which includes a magneticrecording layer. When utilising a metallic foil, the metallic foil canhave a polymer base, coated with a thin (several micron) evaporatedlayer of aluminum or other metal and then coated with a clear protectivelayer adapted to receive the ink via the ink printer mechanism.

[1776] In use the print roll 42 is obviously designed to be insertedinside a camera device so as to provide ink and paper for the printingof images on demand. The ink output ports 635-637 meet withcorresponding ports within the camera device and the pinch rollers 672,673 are operated to allow the supply of paper to the camera device underthe control of the camera device.

[1777] As illustrated in FIG. 164, a mounted silicon chip 53 is insertin one end of the print roll 42. In FIG. 165 the authentication chip 53is shown in more detail and includes four communications leads 680-683for communicating details from the chip 53 to the corresponding camerato which it is inserted.

[1778] Turning to FIG. 165, the chip can be separately created by meansof encasing a small integrated circuit 687 in epoxy and running bondingleads eg. 688 to the external communications leads 680-683. Theintegrated chip 687 being approximately 400 microns square with a 100micron scribe boundary. Subsequently, the chip can be glued to anappropriate surface of the cavity of the print roll 42. In FIG. 166,there is illustrated the integrated circuit 687 interconnected tobonding pads 681, 682 in an exploded view of the arrangement of FIG.165.

[1779] Authentication Chip

[1780] Authentication Chips 53

[1781] The authentication chip 53 of the preferred embodiment isresponsible for ensuring that only correctly manufactured print rollsare utilized in the camera system. The authentication chip 53 utilizestechnologies that are generally valuable when utilized with anyconsumables and are not restricted to print roll system. Manufacturersof other systems that require consumables (such as a laser printer thatrequires toner cartridges) have struggled with the problem ofauthenticating consumables, to varying levels of success. Most haveresorted to specialized packaging. However this does not stop homerefill operations or clone manufacture. The prevention of copying isimportant to prevent poorly manufactured substitute consumables fromdamaging the base system. For example, poorly filtered ink may clogprint nozzles in an ink jet printer, causing the consumer to blame thesystem manufacturer and not admit the use of non-authorized consumables.To solve the authentication problem, the Authentication chip 53 containsan authentication code and circuit specially designed to preventcopying. The chip is manufactured using the standard Flash memorymanufacturing process, and is low cost enough to be included inconsumables such as ink and toner cartridges. Once programmed, theAuthentication chips as described here are compliant with the NSA exportguidelines. Authentication is an extremely large and constantly growingfield. Here we are concerned with authenticating consumables only.

[1782] Symbolic Nomenclature

[1783] The following symbolic nomenclature is used throughout thediscussion of this embodiment: Symbolic Nomenclature Description F[X]Function F, taking a single parameter X F[X, Y] Function F, taking twoparameters, X and Y X | Y X concatenated with Y X

Y Bitwise X AND Y X

Y Bitwise X OR Y (inclusive-OR) X⊕Y Bitwise X XOR Y (exclusive-OR) ˜XBitwise NOT X (complement) X

Y X is assigned the value Y X

{Y, Z} The domain of assignment inputs to X is Y and Z. X = Y X is equalto Y X ≠ Y X is not equal to Y

X Decrement X by 1 (floor 0)

X Increment X by 1 (with wrapping based on register length) Erase XErase Flash memory register X SetBits[X, Y] Set the bits of the Flashmemory register X based on Y Z

ShiftRight Shift register X right one bit position, taking [X, Y] inputbit from Y and placing the output bit in Z

[1784] Basic Terms

[1785] A message, denoted by M, is plaintext. The process oftransforming M into cyphertext C, where the substance of M is hidden, iscalled encryption. The process of transforming C back into M is calleddecryption. Referring to the encryption function as E, and thedecryption function as D, we have the following identities:

E[M]=C

D[C]=M

[1786] Therefore the following identity is true:

D[E[M]]=M

[1787] Symmetric Cryptography

[1788] A symmetric encryption algorithm is one where:

[1789] the encryption function E relies on key K₁,

[1790] the decryption function D relies on key K₂,

[1791] K₂ can be derived from K₁, and

[1792] K₁ can be derived from K₂.

[1793] In most symmetric algorithms, K₁ usually equals K₂. However, evenif K₁ does not equal K₂, given that one key can be derived from theother, a single key K can suffice for the mathematical definition. Thus:

E _(K) [M]=C

D _(K) [C]=M

[1794] An enormous variety of symmetric algorithms exist, from thetextbooks of ancient history through to sophisticated modern algorithms.Many of these are insecure, in that modern cryptanalysis techniques cansuccessfully attack the algorithm to the extent that K can be derived.The security of the particular symmetric algorithm is normally afunction of two things: the strength of the algorithm and the length ofthe key. The following algorithms include suitable aspects forutilization in the authentication chip.

[1795] DES

[1796] Blowfish

[1797] RC5

[1798] IDEA

[1799] DES

[1800] DES (Data Encryption Standard) is a US and internationalstandard, where the same key is used to encrypt and decrypt. The keylength is 56 bits. It has been implemented in hardware and software,although the original design was for hardware only. The originalalgorithm used in DES is described in U.S. Pat. No. 3,962,539. A variantof DES, called triple-DES is more secure, but requires 3 keys: K₁, K₂,and K₃.The keys are used in the following manner:

E _(K3) [D _(K2) [E _(K1) [M]]]=C

D _(K3) [E _(K2) [D _(K1) [C]]]=M

[1801] The main advantage of triple-DES is that existing DESimplementations can be used to give more security than single key DES.Specifically, triple-DES gives protection of equivalent key length of112 bits. Triple-DES does not give the equivalent protection of a168-bit key (3×56) as one might naively expect. Equipment that performstriple-DES decoding and/or encoding cannot be exported from the UnitedStates.

[1802] Blowfish

[1803] Blowfish, is a symmetric block cipher first presented by Schneierin 1994. It takes a variable length key, from 32 bits to 448 bits. Inaddition, it is much faster than DES. The Blowfish algorithm consists oftwo parts: a key-expansion part and a data-encryption part. Keyexpansion converts a key of at most 448 bits into several subkey arraystotaling 4168 bytes. Data encryption occurs via a 16-round Feistelnetwork. All operations are XORs and additions on 32-bit words, withfour index array lookups per round. It should be noted that decryptionis the same as encryption except that the subkey arrays are used in thereverse order. Complexity of implementation is therefore reducedcompared to other algorithms that do not have such symmetry.

[1804] RC5

[1805] Designed by Ron Rivest in 1995, RC5 has a variable block size,key size, and number of rounds. Typically, however, it uses a 64-bitblock size and a 128-bit key. The RC5 algorithm consists of two parts: akey-expansion part and a data-encryption part. Key expansion converts akey into 2r+2 subkeys (where r=the number of rounds), each subkey beingw bits. For a 64-bit blocksize with 16 rounds (w=32, r=16), the subkeyarrays total 136 bytes. Data encryption uses addition mod 2^(w), XOR andbitwise rotation.

[1806] IDEA

[1807] Developed in 1990 by Lai and Massey, the first incarnation of theIDEA cipher was called PES. After differential cryptanalysis wasdiscovered by Biham and Shamir in 1991, the algorithm was strengthened,with the result being published in 1992 as IDEA. IDEA uses 128 bit-keysto operate on 64-bit plaintext blocks. The same algorithm is used forencryption and decryption. It is generally regarded to be the mostsecure block algorithm available today. It is described in U.S. Pat. No.5,214,703, issued in 1993.

[1808] Asymmetric Cryptography

[1809] As alternative an asymmetric algorithm could be used. Anasymmetric encryption algorithm is one where:

[1810] the encryption function E relies on key K₁,

[1811] the decryption function D relies on key K₂,

[1812] K₂ cannot be derived from K₁ in a reasonable amount of time, and

[1813] K₁ cannot be derived from K₂ in a reasonable amount of time.

[1814] Thus:

E _(K1) [M]=C

D _(K2) [C]=M

[1815] These algorithms are also called public-key because one key K₁can be made public. Thus anyone can encrypt a message (using K₁), butonly the person with the corresponding decryption key (K₂) can decryptand thus read the message. In most cases, the following identity alsoholds:

E _(K2) [M]=C

D _(K1) [C]=M

[1816] This identity is very important because it implies that anyonewith the public key K₁ can see M and know that it came from the owner ofK₂. No-one else could have generated C because to do so would implyknowledge of K₂. The property of not being able to derive K₁ from K₂ andvice versa in a reasonable time is of course clouded by the concept ofreasonable time. What has been demonstrated time after time, is that acalculation that was thought to require a long time has been madepossible by the introduction of faster computers, new algorithms etc.The security of asymmetric algorithms is based on the difficulty of oneof two problems: factoring large numbers (more specifically largenumbers that are the product of two large primes), and the difficulty ofcalculating discrete logarithms in a finite field. Factoring largenumbers is conjectured to be a hard problem given today's understandingof mathematics. The problem however, is that factoring is getting easiermuch faster than anticipated. Ron Rivest in 1977 said that factoring a125-digit number would take 40 quadrillion years. In 1994 a 129-digitnumber was factored. According to Schneier, you need a 1024-bit numberto get the level of security today that you got from a 512-bit number inthe 1980's. If the key is to last for some years then 1024 bits may noteven be enough. Rivest revised his key length estimates in 1990: hesuggests 1628 bits for high security lasting until 2005, and 1884 bitsfor high security lasting until 2015. By contrast, Schneier suggests2048 bits are required in order to protect against corporations andgovernments until 2015.

[1817] A number of public key cryptographic algorithms exist. Most areimpractical to implement, and many generate a very large C for a given Mor require enormous keys. Still others, while secure, are far too slowto be practical for several years. Because of this, many public-keysystems are hybrid—a public key mechanism is used to transmit asymmetric session key, and then the session key is used for the actualmessages. All of the algorithms have a problem in terms of keyselection. A random number is simply not secure enough. The two largeprimes p and q must be chosen carefully—there are certain weakcombinations that can be factored more easily (some of the weak keys canbe tested for). But nonetheless, key selection is not a simple matter ofrandomly selecting 1024 bits for example. Consequently the key selectionprocess must also be secure. Of the practical algorithms in use underpublic scrutiny, the following may be suitable for utilization:

[1818] RSA

[1819] DSA

[1820] ElGamal

[1821] RSA

[1822] The RSA cryptosystem, named after Rivest, Shamir, and Adleman, isthe most widely used public-key cryptosystem, and is a de facto standardin much of the world. The security of RSA is conjectured to depend onthe difficulty of factoring large numbers that are the product of twoprimes (p and q). There are a number of restrictions on the generationof p and q. They should both be large, with a similar number of bits,yet not be close to one another (otherwise pq □ öpq). In addition, manyauthors have suggested that p and q should be strong primes. The RSAalgorithm patent was issued in 1983 (U.S. Pat. No. 4,405,829).

[1823] DSA

[1824] DSA (Digital Signature Standard) is an algorithm designed as partof the Digital Signature Standard (DSS). As defined, it cannot be usedfor generalized encryption. In addition, compared to RSA, DSA is 10 to40 times slower for signature verification. DSA explicitly uses theSHA-1 hashing algorithm (see definition in One-way Functions below). DSAkey generation relies on finding two primes p and q such that q dividesp-1. According to Schneier, a 1024-bit p value is required for long termDSA security. However the DSA standard does not permit values of plarger than 1024 bits (p must also be a multiple of 64 bits). The USGovernment owns the DSA algorithm and has at least one relevant patent(U.S. Pat. No. 5,231,688 granted in 1993).

[1825] ElGamal

[1826] The ElGamal scheme is used for both encryption and digitalsignatures. The security is based on the difficulty of calculatingdiscrete logarithms in a finite field. Key selection involves theselection of a prime p, and two random numbers g and x such that both gand x are less than p. Then calculate y=gx mod p. The public key is y,g, and p. The private key is x.

[1827] Cryptographic Challenge-Response Protocols and Zero KnowledgeProofs

[1828] The general principle of a challenge-response protocol is toprovide identity authentication adapted to a camera system. The simplestform of challenge-response takes the form of a secret password. A asks Bfor the secret password, and if B responds with the correct password, Adeclares B authentic. There are three main problems with this kind ofsimplistic protocol. Firstly, once B has given out the password, anyobserver C will know what the password is. Secondly, A must know thepassword in order to verify it. Thirdly, if C impersonates A, then Bwill give the password to C (thinking C was A), thus compromising B.Using a copyright text (such as a haiku) is a weaker alternative as weare assuming that anyone is able to copy the password (for example in acountry where intellectual property is not respected). The idea ofcryptographic challenge-response protocols is that one entity (theclaimant) proves its identity to another (the verifier) by demonstratingknowledge of a secret known to be associated with that entity, withoutrevealing the secret itself to the verifier during the protocol. In thegeneralized case of cryptographic challenge-response protocols, withsome schemes the verifier knows the secret, while in others the secretis not even known by the verifier. Since the discussion of thisembodiment specifically concerns Authentication, the actualcryptographic challenge-response protocols used for authentication aredetailed in the appropriate sections. However the concept of ZeroKnowledge Proofs will be discussed here. The Zero Knowledge Proofprotocol, first described by Feige, Fiat and Shamir is extensively usedin Smart Cards for the purpose of authentication. The protocol'seffectiveness is based on the assumption that it is computationallyinfeasible to compute square roots modulo a large composite integer withunknown factorization. This is provably equivalent to the assumptionthat factoring large integers is difficult. It should be noted thatthere is no need for the claimant to have significant computing power.Smart cards implement this kind of authentication using only a fewmodular multiplications. The Zero Knowledge Proof protocol is describedin U.S. Pat. No. 4,748,668.

[1829] One-Way Functions

[1830] A one-way function F operates on an input X, and returns F[X]such that X cannot be determined from F[X]. When there is no restrictionon the format of X, and F[X] contains fewer bits than X, then collisionsmust exist. A collision is defined as two different X input valuesproducing the same F[X] value—i.e. X₁ and X₂ exist such that X₁≠X₂ yetF[X₁]=F[X₂]. When X contains more bits than F[X], the input must becompressed in some way to create the output. In many cases, X is brokeninto blocks of a particular size, and compressed over a number ofrounds, with the output of one round being the input to the next. Theoutput of the hash function is the last output once X has been consumed.A pseudo-collision of the compression function CF is defined as twodifferent initial values V₁ and V₂ and two inputs X₁ and X₂ (possiblyidentical) are given such that CF(V₁, X₁)=CF(V₂, X₂). Note that theexistence of a pseudo-collision does not mean that it is easy to computean X₂ for a given X₁.

[1831] We are only interested in one-way functions that are fast tocompute. In addition, we are only interested in deterministic one-wayfunctions that are repeatable in different implementations. Consider anexample F where F[X] is the time between calls to F. For a given F[X] Xcannot be determined because X is not even used by F. However the outputfrom F will be different for different implementations. This kind of Fis therefore not of interest. In the scope of the discussion of theimplementation of the authentication chip of this embodiment, we areinterested in the following forms of one-way functions:

[1832] Encryption using an unknown key

[1833] Random number sequences

[1834] Hash Functions

[1835] Message Authentication Codes

[1836] Encryption Using an Unknown Key

[1837] When a message is encrypted using an unknown key K, theencryption function E is effectively one-way. Without the key, it iscomputationally infeasible to obtain M from E_(K)[M] without K. Anencryption function is only one-way for as long as the key remainshidden. An encryption algorithm does not create collisions, since Ecreates E_(K)[M] such that it is possible to reconstruct M usingfunction D. Consequently F[X] contains at least as many bits as X (noinformation is lost) if the one-way function F is E. Symmetricencryption algorithms (see above) have the advantage over Asymmetricalgorithms for producing one-way functions based on encryption for thefollowing reasons:

[1838] The key for a given strength encryption algorithm is shorter fora symmetric algorithm than an asymmetric algorithm

[1839] Symmetric algorithms are faster to compute and require lesssoftware/silicon

[1840] The selection of a good key depends on the encryption algorithmchosen. Certain keys are not strong for particular encryptionalgorithms, so any key needs to be tested for strength. The more teststhat need to be performed for key selection, the less likely the keywill remain hidden.

[1841] Random Number Sequences

[1842] Consider a random number sequence R₀, R₁, . . . , R_(I), R_(i+1).We define the one-way function F such that F[X] returns the X^(th)random number in the random sequence. However we must ensure that F[X]is repeatable for a given X on different implementations. The randomnumber sequence therefore cannot be truly random. Instead, it must bepseudo-random, with the generator making use of a specific seed.

[1843] There are a large number of issues concerned with defining goodrandom number generators. Knuth, describes what makes a generator “good”(including statistical tests), and the general problems associated withconstructing them. The majority of random number generators produce thei^(th) random number from the i−1^(th) state—the only way to determinethe i^(th) number is to iterate from the 0^(th) number to the i^(th). Ifi is large, it may not be practical to wait for i iterations. Howeverthere is a type of random number generator that does allow randomaccess. Blum, Blum and Shub define the ideal generator as follows:“ . .. we would like a pseudo-random sequence generator to quickly produce,from short seeds, long sequences (of bits) that appear in every way tobe generated by successive flips of a fair coin”. They defined the x²mod n generator, more commonly referred to as the BBS generator. Theyshowed that given certain assumptions upon which modern cryptographyrelies, a BBS generator passes extremely stringent statistical tests.

[1844] The BBS generator relies on selecting n which is a Blum integer(n=pq where p and q are large prime numbers, p≠q, p mod 4=3, and q mod4=3). The initial state of the generator is given by x₀ where x₀=x² modn, and x is a random integer relatively prime to n. The i^(th)pseudo-random bit is the least significant bit of x_(i) wherex_(i)=x_(i−1) ² mod n. As an extra property, knowledge of p and q allowsa direct calculation of the i^(th) number in the sequence as follows:x_(i)=x₀ ^(y) mod n, where y=2^(i) mod ((p−1) (q−1)) Without knowledgeof p and q, the generator must iterate (the security of calculationrelies on the difficulty of factoring large numbers). When firstdefined, the primary problem with the BBS generator was the amount ofwork required for a single output bit. The algorithm was considered tooslow for most applications. However the advent of Montgomery reductionarithmetic has given rise to more practical implementations. Inaddition, Vazirani and Vazirani have shown that depending on the size ofn, more bits can safely be taken from x_(i) without compromising thesecurity of the generator. Assuming we only take 1 bit per x_(i), N bits(and hence N iterations of the bit generator function) are needed inorder to generate an N-bit random number. To the outside observer, givena particular set of bits, there is no way to determine the next bitother than a 50/50 probability. If the x, p and q are hidden, they actas a key, and it is computationally unfeasible to take an output bitstream and compute x, p, and q. It is also computationally unfeasible todetermine the value of i used to generate a given set of pseudo-randombits. This last feature makes the generator one-way. Different values ofi can produce identical bit sequences of a given length (e.g. 32 bits ofrandom bits). Even if x, p and q are known, for a given F[i], i can onlybe derived as a set of possibilities, not as a certain value (of courseif the domain of i is known, then the set of possibilities is reducedfurther). However, there are problems in selecting a good p and q, and agood seed x. In particular, Ritter describes a problem in selecting x.The nature of the problem is that a BBS generator does not create asingle cycle of known length. Instead, it creates cycles of variouslengths, including degenerate (zero-length) cycles. Thus a BBS generatorcannot be initialized with a random state—it might be on a short cycle.

[1845] Hash Functions

[1846] Special one-way functions, known as Hash functions map arbitrarylength messages to fixed-length hash values. Hash functions are referredto as H[M]. Since the input is arbitrary length, a hash function has acompression component in order to produce a fixed length output. Hashfunctions also have an obfuscation component in order to make itdifficult to find collisions and to determine information about M fromH[M]. Because collisions do exist, most applications require that thehash algorithm is preimage resistant, in that for a given X₁ it isdifficult to find X₂ such that H[X₁]=H[X₂]. In addition, mostapplications also require the hash algorithm to be collision resistant(i.e. it should be hard to find two messages X₁ and X₂ such thatH[X₁]=H[X₂]). It is an open problem whether a collision-resistant hashfunction, in the idealist sense, can exist at all. The primaryapplication for hash functions is in the reduction of an input messageinto a digital “fingerprint” before the application of a digitalsignature algorithm. One problem of collisions with digital signaturescan be seen in the following example.

[1847] A has a long message M₁ that says “I owe B $10”. A signs H[M₁]using his private key. B, being greedy, then searches for a collisionmessage M₂ where H[M₂]=H[M₁] but where M₂ is favorable to B, for example“I owe B $1 million”. Clearly it is in A's interest to ensure that it isdifficult to find such an M₂.

[1848] Examples of collision resistant one-way hash functions are SHA-1,MD5 and RIPEMD-160, all derived from MD4.

[1849] MD4

[1850] Ron Rivest introduced MD4 in 1990. It is mentioned here becauseall other one-way hash functions are derived in some way from MD4. MD4is now considered completely broken in that collisions can be calculatedinstead of searched for. In the example above, B could triviallygenerate a substitute message M₂ with the same hash value as theoriginal message M₁.

[1851] MD5

[1852] Ron Rivest introduced MD5 in 1991 as a more secure MD4. Like MD4,MD5 produces a 128-bit hash value. Dobbertin describes the status of MD5after recent attacks. He describes how pseudo-collisions have been foundin MD5, indicating a weakness in the compression function, and morerecently, collisions have been found. This means that MD5 should not beused for compression in digital signature schemes where the existence ofcollisions may have dire consequences. However MD5 can still be used asa one-way function. In addition, the HMAC-MD5 construct is not affectedby these recent attacks.

[1853] SHA-1

[1854] SHA-1 is very similar to MD5, but has a 160-bit hash value (MD5only has 128 bits of hash value). SHA-1 was designed and introduced bythe NIST and NSA for use in the Digital Signature Standard (DSS). Theoriginal published description was called SHA, but very soon afterwards,was revised to become SHA-1, supposedly to correct a security flaw inSHA (although the NSA has not released the mathematical reasoning behindthe change). There are no known cryptographic attacks against SHA-1. Itis also more resistant to brute-force attacks than MD4 or MD5 simplybecause of the longer hash result. The US Government owns the SHA-1 andDSA algorithms (a digital signature authentication algorithm defined aspart of DSS) and has at least one relevant patent (U.S. Pat. No.5,231,688 granted in 1993).

[1855] RIPEMD-160

[1856] RIPEMD-160 is a hash function derived from its predecessor RIPEMD(developed for the European Community's RIPE project in 1992). As itsname suggests, RIPEMD-160 produces a 160-bit hash result. Tuned forsoftware implementations on 32-bit architectures, RIPEMD-160 is intendedto provide a high level of security for 10 years or more. Although therehave been no successful attacks on RIPEMD-160, it is comparatively newand has not been extensively cryptanalyzed. The original RIPEMDalgorithm was specifically designed to resist known cryptographicattacks on MD4. The recent attacks on MD5 showed similar weaknesses inthe RIPEMD 128-bit hash function. Although the attacks showed onlytheoretical weaknesses, Dobbertin, Preneel and Bosselaers furtherstrengthened RIPEMD into a new algorithm RIPEMD-160.

[1857] Message Authentication Codes

[1858] The problem of message authentication can be summed up asfollows:

[1859] How can A be sure that a message supposedly from B is in factfrom B?

[1860] Message authentication is different from entity authentication.With entity authentication, one entity (the claimant) proves itsidentity to another (the verifier). With message authentication, we areconcerned with making sure that a given message is from who we think itis from i.e. it has not been tampered en route from the source to itsdestination. A one-way hash function is not sufficient protection for amessage. Hash functions such as MD5 rely on generating a hash value thatis representative of the original input, and the original input cannotbe derived from the hash value. A simple attack by E, who is in-betweenA and B, is to intercept the message from B, and substitute his own.Even if A also sends a hash of the original message, E can simplysubstitute the hash of his new message. Using a one-way hash functionalone, A has no way of knowing that B's message has been changed. Onesolution to the problem of message authentication is the MessageAuthentication Code, or MAC. When B sends message M, it also sendsMAC[M] so that the receiver will know that M is actually from B. Forthis to be possible, only B must be able to produce a MAC of M, and inaddition, A should be able to verify M against MAC[M]. Notice that thisis different from encryption of M-MACs are useful when M does not haveto be secret. The simplest method of constructing a MAC from a hashfunction is to encrypt the hash value with a symmetric algorithm:

[1861] Hash the input message H[M]

[1862] Encrypt the hash E_(K)[H[M]]

[1863] This is more secure than first encrypting the message and thenhashing the encrypted message. Any symmetric or asymmetric cryptographicfunction can be used. However, there are advantages to using akey-dependant one-way hash function instead of techniques that useencryption (such as that shown above):

[1864] Speed, because one-way hash functions in general work much fasterthan encryption;

[1865] Message size, because EK[H[M]] is at least the same size as M,while H[M] is a fixed size (usually considerably smaller than M);

[1866] Hardware/software requirements—keyed one-way hash functions aretypically far less complexity than their encryption-based counterparts;and

[1867] One-way hash function implementations are not considered to beencryption or decryption devices and therefore are not subject to USexport controls.

[1868] It should be noted that hash functions were never originallydesigned to contain a key or to support message authentication. As aresult, some ad hoc methods of using hash functions to perform messageauthentication, including various functions that concatenate messageswith secret prefixes, suffixes, or both have been proposed. Most ofthese ad hoc methods have been successfully attacked by sophisticatedmeans. Additional MACs have been suggested based on XOR schemes andToeplitz matricies (including the special case of LFSR-basedconstructions).

[1869] HMAC

[1870] The HMAC construction in particular is gaining acceptance as asolution for Internet message authentication security protocols. TheHMAC construction acts as a wrapper, using the underlying hash functionin a black-box way. Replacement of the hash function is straightforwardif desired due to security or performance reasons. However, the majoradvantage of the HMAC construct is that it can be proven secure providedthe underlying hash function has some reasonable cryptographicstrengths—that is, HMAC's strengths are directly connected to thestrength of the hash function. Since the HMAC construct is a wrapper,any iterative hash function can be used in an HMAC. Examples includeHMAC-MD5, HMAC-SHA1, HMAC-RIPEMD160 etc. Given the followingdefinitions:

[1871] H=the hash function (e.g. MD5 or SHA-1)

[1872] n=number of bits output from H (e.g. 160 for SHA-1, 128 bits forMD5)

[1873] M=the data to which the MAC function is to be applied

[1874] K=the secret key shared by the two parties

[1875] ipad=0×36 repeated 64 times

[1876] opad=0×5C repeated 64 times

[1877] The HMAC algorithm is as follows:

[1878] Extend K to 64 bytes by appending 0x00 bytes to the end of K

[1879] XOR the 64 byte string created in (1) with ipad

[1880] Append data stream M to the 64 byte string created in (2)

[1881] Apply H to the stream generated in (3)

[1882] XOR the 64 byte string created in (1) with opad

[1883] Append the H result from (4) to the 64 byte string resulting from(5)

[1884] Apply H to the output of (6) and output the result

[1885] Thus:

HMAC[M]=H[(K⊕opad)|H[(K⊕ipad)|M]]

[1886] The recommended key length is at least n bits, although it shouldnot be longer than 64 bytes (the length of the hashing block). A keylonger than n bits does not add to the security of the function. HMACoptionally allows truncation of the final output e.g. truncation to 128bits from 160 bits. The HMAC designers' Request for Comments was issuedin 1997, one year after the algorithm was first introduced. Thedesigners claimed that the strongest known attack against HMAC is basedon the frequency of collisions for the hash function H and is totallyimpractical for minimally reasonable hash functions. More recently, HMACprotocols with replay prevention components have been defined in orderto prevent the capture and replay of any M, HMAC[M] combination within agiven time period.

[1887] Random Numbers and Time Varying Messages

[1888] The use of a random number generator as a one-way function hasalready been examined. However, random number generator theory is verymuch intertwined with cryptography, security, and authentication. Thereare a large number of issues concerned with defining good random numbergenerators. Knuth, describes what makes a generator good (includingstatistical tests), and the general problems associated withconstructing them. One of the uses for random numbers is to ensure thatmessages vary over time. Consider a system where A encrypts commands andsends them to B. If the encryption algorithm produces the same outputfor a given input, an attacker could simply record the messages and playthem back to fool B. There is no need for the attacker to crack theencryption mechanism other than to know which message to play to B(while pretending to be A). Consequently messages often include a randomnumber and a time stamp to ensure that the message (and hence itsencrypted counterpart) varies each time. Random number generators arealso often used to generate keys. It is therefore best to say at themoment, that all generators are insecure for this purpose. For example,the Berlekamp-Massey algorithm, is a classic attack on an LFSR randomnumber generator. If the LFSR is of length n, then only 2 n bits of thesequence suffice to determine the LFSR, compromising the key generator.If, however, the only role of the random number generator is to makesure that messages vary over time, the security of the generator andseed is not as important as it is for session key generation. Ifhowever, the random number seed generator is compromised, and anattacker is able to calculate future “random” numbers, it can leave someprotocols open to attack. Any new protocol should be examined withrespect to this situation. The actual type of random number generatorrequired will depend upon the implementation and the purposes for whichthe generator is used. Generators include Blum, Blum, and Shub, streamciphers such as RC4 by Ron Rivest, hash functions such as SHA-1 andRIPEMD-160, and traditional generators such LFSRs (Linear Feedback ShiftRegisters) and their more recent counterpart FCSRs (Feedback with CarryShift Registers).

[1889] Attacks

[1890] This section describes the various types of attacks that can beundertaken to break an authentication cryptosystem such as theauthentication chip. The attacks are grouped into physical and logicalattacks. Physical attacks describe methods for breaking a physicalimplementation of a cryptosystem (for example, breaking open a chip toretrieve the key), while logical attacks involve attacks on thecryptosystem that are implementation independent. Logical types ofattack work on the protocols or algorithms, and attempt to do one ofthree things:

[1891] Bypass the authentication process altogether

[1892] Obtain the secret key by force or deduction, so that any questioncan be answered

[1893] Find enough about the nature of the authenticating questions andanswers in order to, without the key, give the right answer to eachquestion.

[1894] The attack styles and the forms they take are detailed below.Regardless of the algorithms and protocol used by a security chip, thecircuitry of the authentication part of the chip can come under physicalattack. Physical attack comes in four main ways, although the form ofthe attack can vary:

[1895] Bypassing the Authentication Chip altogether

[1896] Physical examination of chip while in operation (destructive andnon-destructive)

[1897] Physical decomposition of chip

[1898] Physical alteration of chip

[1899] The attack styles and the forms they take are detailed below.This section does not suggest solutions to these attacks. It merelydescribes each attack type. The examination is restricted to the contextof an Authentication chip 53 (as opposed to some other kind of system,such as Internet authentication) attached to some System.

[1900] Logical Attacks

[1901] These attacks are those which do not depend on the physicalimplementation of the cryptosystem. They work against the protocols andthe security of the algorithms and random number generators.

[1902] Ciphertext Only Attack

[1903] This is where an attacker has one or more encrypted messages, allencrypted using the same algorithm. The aim of the attacker is to obtainthe plaintext messages from the encrypted messages. Ideally, the key canbe recovered so that all messages in the future can also be recovered.

[1904] Known Plaintext Attack

[1905] This is where an attacker has both the plaintext and theencrypted form of the plaintext. In the case of an Authentication Chip,a known-plaintext attack is one where the attacker can see the data flowbetween the System and the Authentication Chip. The inputs and outputsare observed (not chosen by the attacker), and can be analyzed forweaknesses (such as birthday attacks or by a search for differentiallyinteresting input/output pairs). A known plaintext attack is a weakertype of attack than the chosen plaintext attack, since the attacker canonly observe the data flow. A known plaintext attack can be carried outby connecting a logic analyzer to the connection between the System andthe Authentication Chip.

[1906] Chosen Plaintext Attacks

[1907] A chosen plaintext attack describes one where a cryptanalyst hasthe ability to send any chosen message to the cryptosystem, and observethe response. If the cryptanalyst knows the algorithm, there may be arelationship between inputs and outputs that can be exploited by feedinga specific output to the input of another function. On a system using anembedded Authentication Chip, it is generally very difficult to preventchosen plaintext attacks since the cryptanalyst can logically pretendhe/she is the System, and thus send any chosen bit-pattern streams tothe Authentication Chip.

[1908] Adaptive Chosen Plaintext Attacks

[1909] This type of attack is similar to the chosen plaintext attacksexcept that the attacker has the added ability to modify subsequentchosen plaintexts based upon the results of previous experiments. Thisis certainly the case with any System/Authentication Chip scenariodescribed when utilized for consumables such as photocopiers and tonercartridges, especially since both Systems and Consumables are madeavailable to the public.

[1910] Brute Force Attack

[1911] A guaranteed way to break any key-based cryptosystem algorithm issimply to try every key. Eventually the right one will be found. This isknown as a Brute Force Attack. However, the more key possibilities thereare, the more keys must be tried, and hence the longer it takes (onaverage) to find the right one. If there are N keys, it will take amaximum of N tries. If the key is N bits long, it will take a maximum of2^(N) tries, with a 50% chance of finding the key after only half theattempts (2^(N−1)). The longer N becomes, the longer it will take tofind the key, and hence the more secure the key is. Of course, an attackmay guess the key on the first try, but this is more unlikely the longerthe key is. Consider a key length of 56 bits. In the worst case, all 2⁵⁶tests (7.2×10¹⁶ tests) must be made to find the key. In 1977, Diffie andHellman described a specialized machine for cracking DES, consisting ofone million processors, each capable of running one million tests persecond. Such a machine would take 20 hours to break any DES code.Consider a key length of 128 bits. In the worst case, all 2¹²⁸ tests(3.4×10³⁸ tests) must be made to find the key. This would take tenbillion years on an array of a trillion processors each running 1billion tests per second. With a long enough key length, a Brute ForceAttack takes too long to be worth the attacker's efforts.

[1912] Guessing Attack

[1913] This type of attack is where an attacker attempts to simply“guess” the key. As an attack it is identical to the Brute force attack,where the odds of success depend on the length of the key.

[1914] Quantum Computer Attack

[1915] To break an n-bit key, a quantum computer (NMR, Optical, or CagedAtom) containing n qubits embedded in an appropriate algorithm must bebuilt. The quantum computer effectively exists in 2^(n) simultaneouscoherent states. The trick is to extract the right coherent statewithout causing any decoherence. To date this has been achieved with a 2qubit system (which exists in 4 coherent states). It is thought possibleto extend this to 6 qubits (with 64 simultaneous coherent states) withina few years.

[1916] Unfortunately, every additional qubit halves the relativestrength of the signal representing the key. This rapidly becomes aserious impediment to key retrieval, especially with the long keys usedin cryptographically secure systems. As a result, attacks on acryptographically secure key (e.g. 160 bits) using a Quantum Computerare likely not to be feasible and it is extremely unlikely that quantumcomputers will have achieved more than 50 or so qubits within thecommercial lifetime of the Authentication Chips. Even using a 50 qubitquantum computer, 2¹¹⁰ tests are required to crack a 160 bit key.

[1917] Purposeful Error Attack

[1918] With certain algorithms, attackers can gather valuableinformation from the results of a bad input. This can range from theerror message text to the time taken for the error to be generated. Asimple example is that of a userid/password scheme. If the error messageusually says “Bad userid”, then when an attacker gets a message saying“Bad password” instead, then they know that the userid is correct. Ifthe message always says “Bad userid/password” then much less informationis given to the attacker. A more complex example is that of the recentpublished method of cracking encryption codes from secure web sites. Theattack involves sending particular messages to a server and observingthe error message responses. The responses give enough information tolearn the keys—even the lack of a response gives some information. Anexample of algorithmic time can be seen with an algorithm that returnsan error as soon as an erroneous bit is detected in the input message.Depending on hardware implementation, it may be a simple method for theattacker to time the response and alter each bit one by one depending onthe time taken for the error response, and thus obtain the key.Certainly in a chip implementation the time taken can be observed withfar greater accuracy than over the Internet.

[1919] Birthday Attack

[1920] This attack is named after the famous “birthday paradox” (whichis not actually a paradox at all). The odds of one person sharing abirthday with another, is 1 in 365 (not counting leap years). Thereforethere must be 183 people in a room for the odds to be more than 50% thatone of them shares your birthday. However, there only needs to be 23people in a room for there to be more than a 50% chance that any twoshare a birthday. This is because 23 people yields 253 different pairs.Birthday attacks are common attacks against hashing algorithms,especially those algorithms that combine hashing with digitalsignatures. If a message has been generated and already signed, anattacker must search for a collision message that hashes to the samevalue (analogous to finding one person who shares your birthday).However, if the attacker can generate the message, the Birthday Attackcomes into play. The attacker searches for two messages that share thesame hash value (analogous to any two people sharing a birthday), onlyone message is acceptable to the person signing it, and the other isbeneficial for the attacker. Once the person has signed the originalmessage the attacker simply claims now that the person signed thealternative message—mathematically there is no way to tell which messagewas the original, since they both hash to the same value. Assuming aBrute Force Attack is the only way to determine a match, the weakeningof an n-bit key by the birthday attack is 2^(n/2). A key length of 128bits that is susceptible to the birthday attack has an effective lengthof only 64 bits.

[1921] Chaining Attack

[1922] These are attacks made against the chaining nature of hashfunctions. They focus on the compression function of a hash function.The idea is based on the fact that a hash function generally takesarbitrary length input and produces a constant length output byprocessing the input n bits at a time. The output from one block is usedas the chaining variable set into the next block. Rather than finding acollision against an entire input, the idea is that given an inputchaining variable set, to find a substitute block that will result inthe same output chaining variables as the proper message. The number ofchoices for a particular block is based on the length of the block. Ifthe chaining variable is c bits, the hashing function behaves like arandom mapping, and the block length is b bits, the number of such b-bitblocks is approximately 2b/2c. The challenge for finding a substitutionblock is that such blocks are a sparse subset of all possible blocks.For SHA-1, the number of 512 bit blocks is approximately 2⁵¹²/2¹⁶⁰, or2³⁵². The chance of finding a block by brute force search is about 1 in2¹⁶⁰.

[1923] Substitution with a Complete Lookup Table

[1924] If the number of potential messages sent to the chip is small,then there is no need for a clone manufacturer to crack the key.Instead, the clone manufacturer could incorporate a ROM in their chipthat had a record of all of the responses from a genuine chip to thecodes sent by the system. The larger the key, and the larger theresponse, the more space is required for such a lookup table.

[1925] Substitution with a Sparse Lookup Table

[1926] If the messages sent to the chip are somehow predictable, ratherthan effectively random, then the clone manufacturer need not provide acomplete lookup table. For example:

[1927] If the message is simply a serial number, the clone manufacturerneed simply provide a lookup table that contains values for past andpredicted future serial numbers. There are unlikely to be more than 10⁹of these.

[1928] If the test code is simply the date, then the clone manufacturercan produce a lookup table using the date as the address.

[1929] If the test code is a pseudo-random number using either theserial number or the date as a seed, then the clone manufacturer justneeds to crack the pseudo-random number generator in the System. This isprobably not difficult, as they have access to the object code of theSystem. The clone manufacturer would then produce a content addressablememory (or other sparse array lookup) using these codes to access storedauthentication codes.

[1930] Differential Cryptanalysis

[1931] Differential cryptanalysis describes an attack where pairs ofinput streams are generated with known differences, and the differencesin the encoded streams are analyzed. Existing differential attacks areheavily dependent on the structure of S boxes, as used in DES and othersimilar algorithms. Although other algorithms such as HMAC-SHA1 have noS boxes, an attacker can undertake a differential-like attack byundertaking statistical analysis of:

[1932] Minimal-difference inputs, and their corresponding outputs

[1933] Minimal-difference outputs, and their corresponding inputs

[1934] Most algorithms were strengthened against differentialcryptanalysis once the process was described. This is covered in thespecific sections devoted to each cryptographic algorithm. However somerecent algorithms developed in secret have been broken because thedevelopers had not considered certain styles of differential attacks anddid not subject their algorithms to public scrutiny.

[1935] Message Substitution Attacks

[1936] In certain protocols, a man-in-the-middle can substitute part orall of a message. This is where a real Authentication Chip is pluggedinto a reusable clone chip within the consumable. The clone chipintercepts all messages between the System and the Authentication Chip,and can perform a number of substitution attacks. Consider a messagecontaining a header followed by content. An attacker may not be able togenerate a valid header, but may be able to substitute their owncontent, especially if the valid response is something along the linesof “Yes, I received your message”. Even if the return message is “Yes, Ireceived the following message . . . ”, the attacker may be able tosubstitute the original message before sending the acknowledgement backto the original sender. Message Authentication Codes were developed tocombat most message substitution attacks.

[1937] Reverse Engineering the Key Generator

[1938] If a pseudo-random number generator is used to generate keys,there is the potential for a clone manufacture to obtain the generatorprogram or to deduce the random seed used. This was the way in which theNetscape security program was initially broken.

[1939] Bypassing Authentication Altogether

[1940] It may be that there are problems in the authentication protocolsthat can allow a bypass of the authentication process altogether. Withthese kinds of attacks the key is completely irrelevant, and theattacker has no need to recover it or deduce it. Consider an example ofa system that Authenticates at power-up, but does not authenticate atany other time. A reusable consumable with a clone Authentication Chipmay make use of a real Authentication Chip. The clone authenticationchip 53 uses the real chip for the authentication call, and thensimulates the real Authentication Chip's state data after that. Anotherexample of bypassing authentication is if the System authenticates onlyafter the consumable has been used. A clone Authentication Chip canaccomplish a simple authentication bypass by simulating a loss ofconnection after the use of the consumable but before the authenticationprotocol has completed (or even started). One infamous attack known asthe “Kentucky Fried Chip” hack involved replacing a microcontroller chipfor a satellite TV system. When a subscriber stopped paying thesubscription fee, the system would send out a “disable” message. Howeverthe new microcontroller would simply detect this message and not pass iton to the consumer's satellite TV system.

[1941] Garrote/Bribe Attack

[1942] If people know the key, there is the possibility that they couldtell someone else. The telling may be due to coercion (bribe, garroteetc), revenge (e.g. a disgruntled employee), or simply for principle.These attacks are usually cheaper and easier than other efforts atdeducing the key. As an example, a number of people claiming to beinvolved with the development of the Divx standard have recently(May/June 1998) been making noises on a variety of DVD newsgroups to theeffect they would like to help develop Divx specific crackingdevices—out of principle.

[1943] Physical Attacks

[1944] The following attacks assume implementation of an authenticationmechanism in a silicon chip that the attacker has physical access to.The first attack, Reading ROM, describes an attack when keys are storedin ROM, while the remaining attacks assume that a secret key is storedin Flash memory.

[1945] Reading ROM

[1946] If a key is stored in ROM it can be read directly. A ROM can thusbe safely used to hold a public key (for use in asymmetriccryptography), but not to hold a private key. In symmetric cryptography,a ROM is completely insecure. Using a copyright text (such as a haiku)as the key is not sufficient, because we are assuming that the cloningof the chip is occurring in a country where intellectual property is notrespected.

[1947] Reverse Engineering of Chip

[1948] Reverse engineering of the chip is where an attacker opens thechip and analyzes the circuitry. Once the circuitry has been analyzedthe inner workings of the chip's algorithm can be recovered. LucentTechnologies have developed an active method known as TOBIC (Two photonOBIC, where OBIC stands for Optical Beam Induced Current), to imagecircuits. Developed primarily for static RAM analysis, the processinvolves removing any back materials, polishing the back surface to amirror finish, and then focusing light on the surface. The excitationwavelength is specifically chosen not to induce a current in the IC. AKerckhoffs in the nineteenth century made a fundamental assumption aboutcryptanalysis: if the algorithm's inner workings are the sole secret ofthe scheme, the scheme is as good as broken. He stipulated that thesecrecy must reside entirely in the key. As a result, the best way toprotect against reverse engineering of the chip is to make the innerworkings irrelevant.

[1949] Usurping the Authentication Process

[1950] It must be assumed that any clone manufacturer has access to boththe System and consumable designs. If the same channel is used forcommunication between the System and a trusted System AuthenticationChip, and a non-trusted consumable Authentication Chip, it may bepossible for the non-trusted chip to interrogate a trustedAuthentication Chip in order to obtain the “correct answer”. If this isso, a clone manufacturer would not have to determine the key. They wouldonly have to trick the System into using the responses from the SystemAuthentication Chip. The alternative method of usurping theauthentication process follows the same method as the logical attack“Bypassing the Authentication Process”, involving simulated loss ofcontact with the System whenever authentication processes take place,simulating power-down etc.

[1951] Modification of System

[1952] This kind of attack is where the System itself is modified toaccept clone consumables. The attack may be a change of System ROM, arewiring of the consumable, or, taken to the extreme case, a completelyclone System. This kind of attack requires each individual System to bemodified, and would most likely require the owner's consent. There wouldusually have to be a clear advantage for the consumer to undertake sucha modification, since it would typically void warranty and would mostlikely be costly. An example of such a modification with a clearadvantage to the consumer is a software patch to change fixed-region DVDplayers into region-free DVD players.

[1953] Direct Viewing of Chip Operation by Conventional Probing

[1954] If chip operation could be directly viewed using an STM or anelectron beam, the keys could be recorded as they are read from theinternal non-volatile memory and loaded into work registers. These formsof conventional probing require direct access to the top or front sidesof the IC while it is powered.

[1955] Direct Viewing of the Non-Volatile Memory

[1956] If the chip were sliced so that the floating gates of the Flashmemory were exposed, without discharging them, then the key couldprobably be viewed directly using an STM or SKM (Scanning KelvinMicroscope). However, slicing the chip to this level without dischargingthe gates is probably impossible. Using wet etching, plasma etching, ionmilling (focused ion beam etching), or chemical mechanical polishingwill almost certainly discharge the small charges present on thefloating gates.

[1957] Viewing the Light Bursts Caused by State Changes

[1958] Whenever a gate changes state, a small amount of infrared energyis emitted. Since silicon is transparent to infrared, these changes canbe observed by looking at the circuitry from the underside of a chip.While the emission process is weak, it is bright enough to be detectedby highly sensitive equipment developed for use in astronomy. Thetechnique, developed by IBM, is called PICA (Picosecond Imaging CircuitAnalyzer). If the state of a register is known at time t, then watchingthat register change over time will reveal the exact value at time t+n,and if the data is part of the key, then that part is compromised.

[1959] Monitoring EMI

[1960] Whenever electronic circuitry operates, faint electromagneticsignals are given off. Relatively inexpensive equipment (a few thousanddollars) can monitor these signals. This could give enough informationto allow an attacker to deduce the keys.

[1961] Viewing I_(dd) Fluctuations

[1962] Even if keys cannot be viewed, there is a fluctuation in currentwhenever registers change state. If there is a high enough signal tonoise ratio, an attacker can monitor the difference in I_(dd) that mayoccur when programming over either a high or a low bit. The change inI_(dd) can reveal information about the key. Attacks such as these havealready been used to break smart cards.

[1963] Differential Fault Analysis

[1964] This attack assumes introduction of a bit error by ionization,microwave radiation, or environmental stress. In most cases such anerror is more likely to adversely affect the Chip (eg cause the programcode to crash) rather than cause beneficial changes which would revealthe key. Targeted faults such as ROM overwrite, gate destruction etc arefar more likely to produce useful results.

[1965] Clock Glitch Attacks

[1966] Chips are typically designed to properly operate within a certainclock speed range. Some attackers attempt to introduce faults in logicby running the chip at extremely high clock speeds or introduce a clockglitch at a particular time for a particular duration. The idea is tocreate race conditions where the circuitry does not function properly.An example could be an AND gate that (because of race conditions) gatesthrough Input₁ all the time instead of the AND of Input₁ and Input₂. Ifan attacker knows the internal structure of the chip, they can attemptto introduce race conditions at the correct moment in the algorithmexecution, thereby revealing information about the key (or in the worstcase, the key itself).

[1967] Power Supply Attacks

[1968] Instead of creating a glitch in the clock signal, attackers canalso produce glitches in the power supply where the power is increasedor decreased to be outside the working operating voltage range. The neteffect is the same as a clock glitch—introduction of error in theexecution of a particular instruction. The idea is to stop the CPU fromXORing the key, or from shifting the data one bit-position etc. Specificinstructions are targeted so that information about the key is revealed.

[1969] Overwriting ROM

[1970] Single bits in a ROM can be overwritten using a laser cuttermicroscope, to either 1 or 0 depending on the sense of the logic. With agiven opcode/operand set, it may be a simple matter for an attacker tochange a conditional jump to a non-conditional jump, or perhaps changethe destination of a register transfer. If the target instruction ischosen carefully, it may result in the key being revealed.

[1971] Modifying EEPROM/Flash

[1972] EEPROM/Flash attacks are similar to ROM attacks except that thelaser cutter microscope technique can be used to both set and resetindividual bits. This gives much greater scope in terms of modificationof algorithms.

[1973] Gate Destruction

[1974] Anderson and Kuhn described the rump session of the 1997 workshopon Fast Software Encryption, where Biham and Shamir presented an attackon DES. The attack was to use a laser cutter to destroy an individualgate in the hardware implementation of a known block cipher (DES). Thenet effect of the attack was to force a particular bit of a register tobe “stuck”. Biham and Shamir described the effect of forcing aparticular register to be affected in this way—the least significant bitof the output from the round function is set to 0. Comparing the 6 leastsignificant bits of the left half and the right half can recover severalbits of the key. Damaging a number of chips in this way can revealenough information about the key to make complete key recovery easy. Anencryption chip modified in this way will have the property thatencryption and decryption will no longer be inverses.

[1975] Overwrite Attacks

[1976] Instead of trying to read the Flash memory, an attacker maysimply set a single bit by use of a laser cutter microscope. Althoughthe attacker doesn't know the previous value, they know the new value.If the chip still works, the bit's original state must be the same asthe new state. If the chip doesn't work any longer, the bit's originalstate must be the logical NOT of the current state. An attacker canperform this attack on each bit of the key and obtain the n-bit keyusing at most n chips (if the new bit matched the old bit, a new chip isnot required for determining the next bit).

[1977] Test Circuitry Attack

[1978] Most chips contain test circuitry specifically designed to checkfor manufacturing defects. This includes BIST (Built In Self Test) andscan paths. Quite often the scan paths and test circuitry includesaccess and readout mechanisms for all the embedded latches. In somecases the test circuitry could potentially be used to give informationabout the contents of particular registers. Test circuitry is oftendisabled once the chip has passed all manufacturing tests, in some casesby blowing a specific connection within the chip. A determined attacker,however, can reconnect the test circuitry and hence enable it.

[1979] Memory Remanence

[1980] Values remain in RAM long after the power has been removed,although they do not remain long enough to be considered non-volatile.An attacker can remove power once sensitive information has been movedinto RAM (for example working registers), and then attempt to read thevalue from RAM. This attack is most useful against security systems thathave regular RAM chips. A classic example is where a security system wasdesigned with an automatic power-shut-off that is triggered when thecomputer case is opened. The attacker was able to simply open the case,remove the RAM chips, and retrieve the key because of memory remanence.

[1981] Chip Theft Attack

[1982] If there are a number of stages in the lifetime of anAuthentication Chip, each of these stages must be examined in terms oframifications for security should chips be stolen. For example, ifinformation is programmed into the chip in stages, theft of a chipbetween stages may allow an attacker to have access to key informationor reduced efforts for attack. Similarly, if a chip is stolen directlyafter manufacture but before programming, does it give an attacker anylogical or physical advantage?

[1983] Requirements

[1984] Existing solutions to the problem of authenticating consumableshave typically relied on physical patents on packaging. However thisdoes not stop home refill operations or clone manufacture in countrieswith weak industrial property protection. Consequently a much higherlevel of protection is required. The authentication mechanism istherefore built into an Authentication chip 53 that allows a system toauthenticate a consumable securely and easily. Limiting ourselves to thesystem authenticating consumables (we don't consider the consumableauthenticating the system), two levels of protection can be considered:

[1985] Presence Only Authentication

[1986] This is where only the presence of an Authentication Chip istested. The Authentication Chip can be reused in another consumablewithout being reprogrammed.

[1987] Consumable Lifetime Authentication

[1988] This is where not only is the presence of the Authentication Chiptested for, but also the Authentication chip 53 must only last thelifetime of the consumable. For the chip to be reused it must becompletely erased and reprogrammed. The two levels of protection addressdifferent requirements. We are primarily concerned with ConsumableLifetime Authentication in order to prevent cloned versions of highvolume consumables. In this case, each chip should hold secure stateinformation about the consumable being authenticated. It should be notedthat a Consumable Lifetime Authentication Chip could be used in anysituation requiring a Presence Only Authentication Chip. Therequirements for authentication, data storage integrity and manufactureshould be considered separately. The following sections summarizerequirements of each.

[1989] Authentication

[1990] The authentication requirements for both Presence OnlyAuthentication and Consumable Lifetime Authentication are restricted tocase of a system authenticating a consumable. For Presence OnlyAuthentication, we must be assured that an Authentication Chip isphysically present. For Consumable Lifetime Authentication we also needto be assured that state data actually came from the AuthenticationChip, and that it has not been altered en route. These issues cannot beseparated—data that has been altered has a new source, and if the sourcecannot be determined, the question of alteration cannot be settled. Itis not enough to provide an authentication method that is secret,relying on a home-brew security method that has not been scrutinized bysecurity experts. The primary requirement therefore is to provideauthentication by means that have withstood the scrutiny of experts. Theauthentication scheme used by the Authentication chip 53 should beresistant to defeat by logical means. Logical types of attack areextensive, and attempt to do one of three things:

[1991] Bypass the authentication process altogether

[1992] Obtain the secret key by force or deduction, so that any questioncan be answered

[1993] Find enough about the nature of the authenticating questions andanswers in order to, without the key, give the right answer to eachquestion.

[1994] Data Storage Integrity

[1995] Although Authentication protocols take care of ensuring dataintegrity in communicated messages, data storage integrity is alsorequired. Two kinds of data must be stored within the AuthenticationChip:

[1996] Authentication data, such as secret keys

[1997] Consumable state data, such as serial numbers, and mediaremaining etc.

[1998] The access requirements of these two data types differ greatly.The Authentication chip 53 therefore requires a storage/access controlmechanism that allows for the integrity requirements of each type.

[1999] Authentication Data

[2000] Authentication data must remain confidential. It needs to bestored in the chip during a manufacturing/programming stage of thechip's life, but from then on must not be permitted to leave the chip.It must be resistant to being read from non-volatile memory. Theauthentication scheme is responsible for ensuring the key cannot beobtained by deduction, and the manufacturing process is responsible forensuring that the key cannot be obtained by physical means. The size ofthe authentication data memory area must be large enough to hold thenecessary keys and secret information as mandated by the authenticationprotocols.

[2001] Consumable State Data

[2002] Each Authentication chip 53 needs to be able to also store 256bits (32 bytes) of consumable state data. Consumable state data can bedivided into the following types. Depending on the application, therewill be different numbers of each of these types of data items. Amaximum number of 32 bits for a single data item is to be considered.

[2003] Read Only

[2004] ReadWrite

[2005] Decrement Only

[2006] Read Only data needs to be stored in the chip during amanufacturing/programming stage of the chip's life, but from then onshould not be allowed to change. Examples of Read Only data items areconsumable batch numbers and serial numbers.

[2007] ReadWrite data is changeable state information, for example, thelast time the particular consumable was used. ReadWrite data items canbe read and written an unlimited number of times during the lifetime ofthe consumable. They can be used to store any state information aboutthe consumable. The only requirement for this data is that it needs tobe kept in non-volatile memory. Since an attacker can obtain access to asystem (which can write to ReadWrite data), any attacker can potentiallychange data fields of this type. This data type should not be used forsecret information, and must be considered insecure.

[2008] Decrement Only data is used to count down the availability ofconsumable resources. A photocopier's toner cartridge, for example, maystore the amount of toner remaining as a Decrement Only data item. Anink cartridge for a color printer may store the amount of each ink coloras a Decrement Only data item, requiring 3 (one for each of Cyan,Magenta, and Yellow), or even as many as 5 or 6 Decrement Only dataitems. The requirement for this kind of data item is that onceprogrammed with an initial value at the manufacturing/programming stage,it can only reduce in value. Once it reaches the minimum value, itcannot decrement any further. The Decrement Only data item is onlyrequired by Consumable Lifetime Authentication.

[2009] Manufacture

[2010] The Authentication chip 53 ideally must have a low manufacturingcost in order to be included as the authentication mechanism for lowcost consumables. The Authentication chip 53 should use a standardmanufacturing process, such as Flash. This is necessary to:

[2011] Allow a great range of manufacturing location options

[2012] Use well-defined and well-behaved technology

[2013] Reduce cost

[2014] Regardless of the authentication scheme used, the circuitry ofthe authentication part of the chip must be resistant to physicalattack. Physical attack comes in four main ways, although the form ofthe attack can vary:

[2015] Bypassing the Authentication Chip altogether

[2016] Physical examination of chip while in operation (destructive andnon-destructive)

[2017] Physical decomposition of chip

[2018] Physical alteration of chip

[2019] Ideally, the chip should be exportable from the U.S., so itshould not be possible to use an Authentication chip 53 as a secureencryption device. This is low priority requirement since there are manycompanies in other countries able to manufacture the Authenticationchips. In any case, the export restrictions from the U.S. may change.

[2020] Authentication

[2021] Existing solutions to the problem of authenticating consumableshave typically relied on physical patents on packaging. However thisdoes not stop home refill operations or clone manufacture in countrieswith weak industrial property protection. Consequently a much higherlevel of protection is required. It is not enough to provide anauthentication method that is secret, relying on a home-brew securitymethod that has not been scrutinized by security experts. Securitysystems such as Netscape's original proprietary system and the GSM FraudPrevention Network used by cellular phones are examples where designsecrecy caused the vulnerability of the security. Both security systemswere broken by conventional means that would have been detected if thecompanies had followed an open design process. The solution is toprovide authentication by means that have withstood the scrutiny ofexperts. A number of protocols that can be used for consumablesauthentication. We only use security methods that are publiclydescribed, using known behaviors in this new way. For all protocols, thesecurity of the scheme relies on a secret key, not a secret algorithm.All the protocols rely on a time-variant challenge (i.e. the challengeis different each time), where the response depends on the challenge andthe secret. The challenge involves a random number so that any observerwill not be able to gather useful information about a subsequentidentification. Two protocols are presented for each of Presence OnlyAuthentication and Consumable Lifetime Authentication. Although theprotocols differ in the number of Authentication Chips required for theauthentication process, in all cases the System authenticates theconsumable. Certain protocols will work with either one or two chips,while other protocols only work with two chips. Whether one chip or twoAuthentication Chips are used the System is still responsible for makingthe authentication decision.

[2022] Single Chip Authentication

[2023] When only one Authentication chip 53 is used for theauthentication protocol, a single chip (referred to as ChipA) isresponsible for proving to a system (referred to as System) that it isauthentic. At the start of the protocol, System is unsure of ChipA'sauthenticity. System undertakes a challenge-response protocol withChipA, and thus determines ChipA's authenticity. In all protocols theauthenticity of the consumable is directly based on the authenticity ofthe chip, i.e. if ChipA is considered authentic, then the consumable isconsidered authentic. The data flow can be seen in FIG. 167. In singlechip authentication protocols, System can be software, hardware or acombination of both. It is important to note that System is consideredinsecure—it can be easily reverse engineered by an attacker, either byexamining the ROM or by examining circuitry. System is not speciallyengineered to be secure in itself.

[2024] Double Chip Authentication

[2025] In other protocols, two Authentication Chips are required asshown in FIG. 168. A single chip (referred to as ChipA) is responsiblefor proving to a system (referred to as System) that it is authentic. Aspart of the authentication process, System makes use of a trustedAuthentication Chip (referred to as ChipT). In double chipauthentication protocols, System can be software, hardware or acombination of both. However ChipT must be a physical AuthenticationChip. In some protocols ChipT and ChipA have the same internalstructure, while in others ChipT and ChipA have different internalstructures.

[2026] Presence Only Authentication (Insecure State Data)

[2027] For this level of consumable authentication we are only concernedabout validating the presence of the Authentication chip 53. Althoughthe Authentication Chip can contain state information, the transmissionof that state information would not be considered secure. Two protocolsare presented. Protocol 1 requires 2 Authentication Chips, whileProtocol 2 can be implemented using either 1 or 2 Authentication Chips.

[2028] Protocol 1

[2029] Protocol 1 is a double chip protocol (two Authentication Chipsare required). Each Authentication Chip contains the following values:

[2030] K Key for F_(K)[X]. Must be secret.

[2031] R Current random number. Does not have to be secret, but must beseeded with a different initial value for each chip instance. Changeswith each invocation of the Random function.

[2032] Each Authentication Chip contains the following logicalfunctions:

[2033] Random[ ] Returns R, and advances R to next in sequence.

[2034] F[X] Returns F_(K)[X], the result of applying a one-way functionF to X based upon the secret key K.

[2035] The Protocol is as Follows:

[2036] System requests Random[ ] from ChipT;

[2037] ChipT returns R to System;

[2038] System requests F[R] from both ChipT and ChipA;

[2039] ChipT returns F_(KT)[R] to System;

[2040] ChipA returns F_(KA)[R] to System;

[2041] System compares F_(KT)[R] with F_(KA)[R]. If they are equal, thenChipA is considered valid. If not, then ChipA is considered invalid.

[2042] The data flow can be seen in FIG. 169. The System does not haveto comprehend F_(K)[R] messages. It must merely check that the responsesfrom ChipA and ChipT are the same. The System therefore does not requirethe key. The security of Protocol 1 lies in two places:

[2043] The security of F[X]. Only Authentication chips contain thesecret key, so anything that can produce an F[X] from an X that matchesthe F[X] generated by a trusted Authentication chip 53 (ChipT) must beauthentic.

[2044] The domain of R generated by all Authentication chips must belarge and non-deterministic. If the domain of R generated by allAuthentication chips is small, then there is no need for a clonemanufacturer to crack the key. Instead, the clone manufacturer couldincorporate a ROM in their chip that had a record of all of theresponses from a genuine chip to the codes sent by the system. TheRandom function does not strictly have to be in the Authentication Chip,since System can potentially generate the same random number sequence.However it simplifies the design of System and ensures the security ofthe random number generator will be the same for all implementationsthat use the Authentication Chip, reducing possible error in systemimplementation.

[2045] Protocol 1 has several advantages:

[2046] K is not revealed during the authentication process

[2047] Given X, a clone chip cannot generate F_(K)[X] without K oraccess to a real Authentication Chip.

[2048] System is easy to design, especially in low cost systems such asink-jet printers, as no encryption or decryption is required by Systemitself.

[2049] A wide range of keyed one-way functions exists, includingsymmetric cryptography, random number sequences, and messageauthentication codes.

[2050] One-way functions require fewer gates and are easier to verifythan asymmetric algorithms).

[2051] Secure key size for a keyed one-way function does not have to beas large as for an asymmetric (public key) algorithm. A minimum of 128bits can provide appropriate security if F[X] is a symmetriccryptographic function.

[2052] However there are problems with this protocol:

[2053] It is susceptible to chosen text attack. An attacker can plug thechip into their own system, generate chosen Rs, and observe the output.In order to find the key, an attacker can also search for an R that willgenerate a specific F[M] since multiple Authentication chips can betested in parallel.

[2054] Depending on the one-way function chosen, key generation can becomplicated. The method of selecting a good key depends on the algorithmbeing used. Certain keys are weak for a given algorithm.

[2055] The choice of the keyed one-way functions itself is non-trivial.Some require licensing due to patent protection.

[2056] A man-in-the middle could take action on a plaintext message Mbefore passing it on to ChipA—it would be preferable if theman-in-the-middle did not see M until after ChipA had seen it. It wouldbe even more preferable if a man-in-the-middle didn't see M at all.

[2057] If F is symmetric encryption, because of the key size needed foradequate security, the chips could not be exported from the USA sincethey could be used as strong encryption devices.

[2058] If Protocol 1 is implemented with F as an asymmetric encryptionalgorithm, there is no advantage over the symmetric case—the keys needsto be longer and the encryption algorithm is more expensive in silicon.Protocol 1 must be implemented with 2 Authentication Chips in order tokeep the key secure. This means that each System requires anAuthentication Chip and each consumable requires an Authentication Chip.

[2059] Protocol 2

[2060] In some cases, System may contain a large amount of processingpower. Alternatively, for instances of systems that are manufactured inlarge quantities, integration of ChipT into System may be desirable. Useof an asymmetrical encryption algorithm allows the ChipT portion ofSystem to be insecure. Protocol 2 therefore, uses asymmetriccryptography. For this protocol, each chip contains the followingvalues:

[2061] K Key for E_(K)[X] and D_(K)[X]. Must be secret in ChipA. Doesnot have to be secret in ChipT.

[2062] R Current random number. Does not have to be secret, but must beseeded with a different initial value for each chip instance. Changeswith each invocation of the Random function.

[2063] The following functions are defined:

[2064] E[X] ChipT only. Returns E_(K)[X] where E is asymmetric encryptfunction E.

[2065] D[X] ChipA only. Returns D_(K)[X] where D is asymmetric decryptfunction D.

[2066] Random[ ] ChipT only. Returns R|E_(K)[R], where R is randomnumber based on seed S. Advances R to next in random number sequence.

[2067] The public key K_(T) is in ChipT, while the secret key K_(A) isin ChipA. Having K_(T) in ChipT has the advantage that ChipT can beimplemented in software or hardware (with the proviso that the seed forR is different for each chip or system). Protocol 2 therefore can beimplemented as a Single Chip Protocol or as a Double Chip Protocol. Theprotocol for authentication is as follows:

[2068] System calls ChipT's Random function;

[2069] ChipT returns R|E_(KT)[R] to System;

[2070] System calls ChipA's D function, passing in E_(KT)[R];

[2071] ChipA returns R, obtained by D_(KA)[E_(KT)[R]];

[2072] System compares R from ChipA to the original R generated byChipT. If they are equal, then ChipA is considered valid. If not, ChipAis invalid.

[2073] The data flow can be seen in FIG. 170. Protocol 2 has thefollowing advantages:

[2074] K_(A) (the secret key) is not revealed during the authenticationprocess

[2075] Given E_(KT)[X], a clone chip cannot generate X without K_(A) oraccess to a real ChipA.

[2076] Since K_(T)□K_(A), ChipT can be implemented completely insoftware or in insecure hardware or as part of System. Only ChipA (inthe consumable) is required to be a secure Authentication Chip.

[2077] If ChipT is a physical chip, System is easy to design.

[2078] There are a number of well-documented and cryptanalyzedasymmetric algorithms to chose from for implementation, includingpatent-free and license-free solutions.

[2079] However, Protocol 2 has a number of its own problems:

[2080] For satisfactory security, each key needs to be 2048 bits(compared to minimum 128 bits for symmetric cryptography in Protocol 1).The associated intermediate memory used by the encryption and decryptionalgorithms is correspondingly larger.

[2081] Key generation is non-trivial. Random numbers are not good keys.

[2082] If ChipT is implemented as a core, there may be difficulties inlinking it into a given System ASIC.

[2083] If ChipT is implemented as software, not only is theimplementation of System open to programming error and non-rigoroustesting, but the integrity of the compiler and mathematics primitivesmust be rigorously checked for each implementation of System. This ismore complicated and costly than simply using a well-tested chip.

[2084] Although many symmetric algorithms are specifically strengthenedto be resistant to differential cryptanalysis (which is based on chosentext attacks), the private key K_(A) is susceptible to a chosen textattack

[2085] If ChipA and ChipT are instances of the same Authentication Chip,each chip must contain both asymmetric encrypt and decryptfunctionality. Consequently each chip is larger, more complex, and moreexpensive than the chip required for Protocol 1.

[2086] If the Authentication Chip is broken into 2 chips to save costand reduce complexity of design/test, two chips still need to bemanufactured, reducing the economies of scale. This is offset by therelative numbers of systems to consumables, but must still be taken intoaccount.

[2087] Protocol 2 Authentication Chips could not be exported from theUSA, since they would be considered strong encryption devices.

[2088] Even if the process of choosing a key for Protocol 2 wasstraightforward, Protocol 2 is impractical at the present time due tothe high cost of silicon implementation (both key size and functionalimplementation). Therefore Protocol 1 is the protocol of choice forPresence Only Authentication.

[2089] Clone Consumable Using Real Authentication Chip

[2090] Protocols 1 and 2 only check that ChipA is a real AuthenticationChip. They do not check to see if the consumable itself is valid. Thefundamental assumption for authentication is that if ChipA is valid, theconsumable is valid. It is therefore possible for a clone manufacturerto insert a real Authentication Chip into a clone consumable. There aretwo cases to consider:

[2091] In cases where state data is not written to the AuthenticationChip, the chip is completely reusable. Clone manufacturers couldtherefore recycle a valid consumable into a clone consumable. This maybe made more difficult by melding the Authentication Chip into theconsumable's physical packaging, but it would not stop refill operators.

[2092] In cases where state data is written to the Authentication Chip,the chip may be new, partially used up, or completely used up. Howeverthis does not stop a clone manufacturer from using the Piggyback attack,where the clone manufacturer builds a chip that has a realAuthentication Chip as a piggyback. The Attacker's chip (ChipE) istherefore a man-in-the-middle. At power up, ChipE reads all the memorystate values from the real Authentication chip 53 into its own memory.ChipE then examines requests from System, and takes different actionsdepending on the request. Authentication requests can be passed directlyto the real Authentication chip 53, while read/write requests can besimulated by a memory that resembles real Authentication Chip behavior.In this way the Authentication chip 53 will always appear fresh atpower-up. ChipE can do this because the data access is notauthenticated.

[2093] In order to fool System into thinking its data accesses weresuccessful, ChipE still requires a real Authentication Chip, and in thesecond case, a clone chip is required in addition to a realAuthentication Chip. Consequently Protocols 1 and 2 can be useful insituations where it is not cost effective for a clone manufacturer toembed a real Authentication chip 53 into the consumable. If theconsumable cannot be recycled or refilled easily, it may be protectionenough to use Protocols 1 or 2. For a clone operation to be successfuleach clone consumable must include a valid Authentication Chip. Thechips would have to be stolen en masse, or taken from old consumables.The quantity of these reclaimed chips (as well as the effort inreclaiming them) should not be enough to base a business on, so theadded protection of secure data transfer (see Protocols 3 and 4) may notbe useful.

[2094] Longevity of Key

[2095] A general problem of these two protocols is that once theauthentication key is chosen, it cannot easily be changed. In someinstances a key-compromise is not a problem, while for others a keycompromise is disastrous. For example, in a car/car-keySystem/Consumable scenario, the customer has only one set ofcar/car-keys. Each car has a different authentication key. Consequentlythe loss of a car-key only compromises the individual car. If the ownerconsiders this a problem, they must get a new lock on the car byreplacing the System chip inside the car's electronics. The owner's keysmust be reprogrammed/replaced to work with the new car SystemAuthentication Chip. By contrast, a compromise of a key for a highvolume consumable market (for example ink cartridges in printers) wouldallow a clone ink cartridge manufacturer to make their ownAuthentication Chips. The only solution for existing systems is toupdate the System Authentication Chips, which is a costly andlogistically difficult exercise. In any case, consumers' Systems alreadywork—they have no incentive to hobble their existing equipment.

[2096] Consumable Lifetime Authentication

[2097] In this level of consumable authentication we are concerned withvalidating the existence of the Authentication Chip, as well as ensuringthat the Authentication Chip lasts only as long as the consumable. Inaddition to validating that an Authentication Chip is present, writesand reads of the Authentication Chip's memory space must beauthenticated as well. In this section we assume that the AuthenticationChip's data storage integrity is secure—certain parts of memory are ReadOnly, others are Read/Write, while others are Decrement Only (see thechapter entitled Data Storage Integrity for more information). Twoprotocols are presented. Protocol 3 requires 2 Authentication Chips,while Protocol 4 can be implemented using either 1 or 2 AuthenticationChips.

[2098] Protocol 3

[2099] This protocol is a double chip protocol (two Authentication Chipsare required). For this protocol, each Authentication Chip contains thefollowing values:

[2100] K₁ Key for calculating F_(K1)[X]. Must be secret.

[2101] K₂ Key for calculating F_(K2)[X]. Must be secret.

[2102] R Current random number. Does not have to be secret, but must beseeded with a different initial value for each chip instance. Changeswith each successful authentication as defined by the Test function.

[2103] M Memory vector of Authentication chip 53. Part of this spaceshould be different for each chip (does not have to be a random number).

[2104] Each Authentication Chip contains the following logicalfunctions:

[2105] F[X] Internal function only. Returns F_(K)[X], the result ofapplying a one-way function F to X based upon either key K₁ or key K₂

[2106] Random[ ] Returns R|F_(K1)[R].

[2107] Test[X, Y] Returns land advances R if F_(K2)[R|X]=Y. Otherwisereturns 0. The time taken to return 0 must be identical for all badinputs.

[2108] Read[X, Y] Returns M|F_(K2)[X|M] if F_(K1)[X]=Y. Otherwisereturns 0. The time taken to return 0 must be identical for all badinputs.

[2109] Write[X] Writes X over those parts of M that can legitimately bewritten over.

[2110] To authenticate ChipA and read ChipA's memory M:

[2111] System calls ChipT's Random function;

[2112] ChipT produces R|F_(K)[R] and returns these to System;

[2113] System calls ChipA's Read function, passing in R, F_(K)[R];

[2114] ChipA returns M and F_(K)[R|M];

[2115] System calls ChipT's Test function, passing in M and F_(K)[R|M];

[2116] System checks response from ChipT. If the response is 1, thenChipA is considered authentic. If 0, ChipA is considered invalid.

[2117] To authenticate a write of Mnew to ChipA's memory M:

[2118] System calls ChipA's Write function, passing in M_(new);

[2119] The authentication procedure for a Read is carried out;

[2120] If ChipA is authentic and M_(new)=M, the write succeeded.Otherwise it failed.

[2121] The data flow for read authentication is shown in FIG. 171. Thefirst thing to note about Protocol 3 is that F_(K)[X] cannot be calleddirectly. Instead F_(K)[X] is called indirectly by Random, Test andRead:

[2122] Random[ ] calls F_(K1)[X] X is not chosen by the caller. It ischosen by the Random function. An attacker must perform a brute forcesearch using multiple calls to Random, Read, and Test to obtain adesired X, F_(K1)[X] pair.

[2123] Test[X,Y] calls F_(K2)[R|X] Does not return result directly, butcompares the result to Y and then returns 1 or 0. Any attempt to deduceK₂ by calling Test multiple times trying different values of F_(K2)[R|X]for a given X is reduced to a brute force search where R cannot even bechosen by the attacker.

[2124] Read[X, Y] calls F_(K1)[X] X and F_(K1)[X] must be supplied bycaller, so the caller must already know the X, F_(K1)[X] pair. Since thecall returns 0 if Y≠F_(K1)[X], a caller can use the Read function for abrute force attack on K₁.

[2125] Read[X, Y] calls F_(K2)[X|M], X is supplied by caller, however Xcan only be those values already given out by the Random function (sinceX and Y are validated via K₁). Thus a chosen text attack must firstcollect pairs from Random (effectively a brute force attack). Inaddition, only part of M can be used in a chosen text attack since someof M is constant (read-only) and the decrement-only part of M can onlybe used once per consumable. In the next consumable the read-only partof M will be different.

[2126] Having F_(K)[X] being called indirectly prevents chosen textattacks on the Authentication Chip. Since an attacker can only obtain achosen R, F_(K1)[R] pair by calling Random, Read, and Test multipletimes until the desired R appears, a brute force attack on K₁ isrequired in order to perform a limited chosen text attack on K₂. Anyattempt at a chosen text attack on K₂ would be limited since the textcannot be completely chosen: parts of M are read-only, yet different foreach Authentication Chip. The second thing to note is that two keys areused. Given the small size of M, two different keys K₁ and K₂ are usedin order to ensure there is no correlation between F[R] and F[R|M]. K₁is therefore used to help protect K₂ against differential attacks. It isnot enough to use a single longer key since M is only 256 bits, and onlypart of M changes during the lifetime of the consumable. Otherwise it ispotentially possible that an attacker via some as-yet undiscoveredtechnique, could determine the effect of the limited changes in M toparticular bit combinations in R and thus calculate F_(K2)[X|M] based onF_(K1)[X]. As an added precaution, the Random and Test functions inChipA should be disabled so that in order to generate R, F_(K)[R] pairs,an attacker must use instances of ChipT, each of which is more expensivethan ChipA (since a system must be obtained for each ChipT). Similarly,there should be a minimum delay between calls to Random, Read and Testso that an attacker cannot call these functions at high speed. Thus eachchip can only give a specific number of X, F_(K)[X] pairs away in acertain time period. The only specific timing requirement of Protocol 3is that the return value of 0 (indicating a bad input) must be producedin the same amount of time regardless of where the error is in theinput. Attackers can therefore not learn anything about what was badabout the input value. This is true for both RD and TST functions.

[2127] Another thing to note about Protocol 3 is that Reading data fromChipA also requires authentication of ChipA. The System can be sure thatthe contents of memory (M) is what ChipA claims it to be if F_(K2)[R|M]is returned correctly. A clone chip may pretend that M is a certainvalue (for example it may pretend that the consumable is full), but itcannot return F_(K2)[R|M] for any R passed in by System. Thus theeffective signature F_(K2)[R|M] assures System that not only did anauthentic ChipA send M, but also that M was not altered in between ChipAand System. Finally, the Write function as defined does not authenticatethe Write. To authenticate a write, the System must perform a Read aftereach Write. There are some basic advantages with Protocol 3:

[2128] K₁ and K₂ are not revealed during the authentication process

[2129] Given X, a clone chip cannot generate F_(K2)[X|M] without the keyor access to a real Authentication Chip.

[2130] System is easy to design, especially in low cost systems such asink-jet printers, as no encryption or decryption is required by Systemitself.

[2131] A wide range of key based one-way functions exists, includingsymmetric cryptography, random number sequences, and messageauthentication codes.

[2132] Keyed one-way functions require fewer gates and are easier toverify than asymmetric algorithms).

[2133] Secure key size for a keyed one-way function does not have to beas large as for an asymmetric (public key) algorithm. A minimum of 128bits can provide appropriate security if F[X] is a symmetriccryptographic function.

[2134] Consequently, with Protocol 3, the only way to authenticate ChipAis to read the contents of ChipA's memory. The security of this protocoldepends on the underlying F_(K)[X] scheme and the domain of R over theset of all Systems. Although F_(K)[X] can be any keyed one-way function,there is no advantage to implement it as asymmetric encryption. The keysneed to be longer and the encryption algorithm is more expensive insilicon. This leads to a second protocol for use with asymmetricalgorithms—Protocol 4. Protocol 3 must be implemented with 2Authentication Chips in order to keep the keys secure. This means thateach System requires an Authentication Chip and each consumable requiresan Authentication Chip

[2135] Protocol 4

[2136] In some cases, System may contain a large amount of processingpower. Alternatively, for instances of systems that are manufactured inlarge quantities, integration of ChipT into System may be desirable. Useof an asymmetrical encryption algorithm can allow the ChipT portion ofSystem to be insecure. Protocol 4 therefore, uses asymmetriccryptography. For this protocol, each chip contains the followingvalues:

[2137] K Key for E_(K)[X] and D_(K)[X]. Must be secret in ChipA. Doesnot have to be secret in ChipT.

[2138] R Current random number. Does not have to be secret, but must beseeded with a different initial value for each chip instance. Changeswith each successful authentication as defined by the Test function.

[2139] M Memory vector of Authentication chip 53. Part of this spaceshould be different for each chip, (does not have to be a randomnumber).

[2140] There is no point in verifying anything in the Read function,since anyone can encrypt using a public key. Consequently the followingfunctions are defined:

[2141] E[X] Internal function only. Returns E_(K)[X] where E isasymmetric encrypt function E.

[2142] D[X] Internal function only. Returns D_(K)[X] where D isasymmetric decrypt function D.

[2143] Random[ ] ChipT only. Returns E_(K)[R].

[2144] Test[X, Y] Returns 1 and advances R if D_(K)[R|X]=Y. Otherwisereturns 0. The time taken to return 0 must be identical for all badinputs.

[2145] Read[X] Returns M|E_(K)[R|M] where R=D_(K)[X] (does not testinput).

[2146] Write[X] Writes X over those parts of M that can legitimately bewritten over.

[2147] The public key K_(T) is in ChipT, while the secret key K_(A) isin ChipA. Having K_(T) in ChipT has the advantage that ChipT can beimplemented in software or hardware (with the proviso that R is seededwith a different random number for each system). To authenticate ChipAand read ChipA's memory M:

[2148] System calls ChipT's Random function;

[2149] ChipT produces ad returns E_(KT)[R] to System;

[2150] System calls ChipA's Read function, passing in E_(KT)[R];

[2151] ChipA returns M|E_(KA)[R|M], first obtaining R byD_(KA)[E_(KT)[R]];

[2152] System calls ChipT's Test function, passing in M and E_(KA)[R|M];

[2153] ChipT calculates D_(KT)[E_(KA)[R|M]] and compares it to R|M.

[2154] System checks response from ChipT. If the response is 1, thenChipA is considered authentic. If 0, ChipA is considered invalid.

[2155] To authenticate a write of M_(new) to ChipA's memory M:

[2156] System calls ChipA's Write function, passing in M_(new);

[2157] The authentication procedure for a Read is carried out;

[2158] If ChipA is authentic and M_(new)=M, the write succeeded.Otherwise it failed.

[2159] The data flow for read authentication is shown in FIG. 172. Onlya valid ChipA would know the value of R, since R is not passed into theAuthenticate function (it is passed in as an encrypted value). R must beobtained by decrypting E[R], which can only be done using the secret keyK_(A). Once obtained, R must be appended to M and then the resultre-encoded. ChipT can then verify that the decoded form ofE_(KA)[R|M]=R|M and hence ChipA is valid. Since K_(T)≠K_(A),E_(KT)[R]≠E_(KA)[R]. Protocol 4 has the following advantages:

[2160] K_(A) (the secret key) is not revealed during the authenticationprocess

[2161] Given E_(KT)[X], a clone chip cannot generate X without K_(A) oraccess to a real ChipA.

[2162] Since K_(T)≠K_(A), ChipT can be implemented completely insoftware or in insecure hardware or as part of System. Only ChipA isrequired to be a secure Authentication Chip.

[2163] Since ChipT and ChipA contain different keys, intense testing ofChipT will reveal nothing about K_(A).

[2164] If ChipT is a physical chip, System is easy to design.

[2165] There are a number of well-documented and cryptanalyzedasymmetric algorithms to chose from for implementation, includingpatent-free and license-free solutions.

[2166] Even if System could be rewired so that ChipA requests weredirected to ChipT, ChipT could never answer for ChipA since K_(T)□K_(A).The attack would have to be directed at the System ROM itself to bypassthe Authentication protocol.

[2167] However, Protocol 4 has a number of disadvantages:

[2168] All Authentication Chips need to contain both asymmetric encryptand decrypt functionality. Consequently each chip is larger, morecomplex, and more expensive than the chip required for Protocol 3.

[2169] For satisfactory security, each key needs to be 2048 bits(compared to a minimum of 128 bits for symmetric cryptography inProtocol 1). The associated intermediate memory used by the encryptionand decryption algorithms is correspondingly larger.

[2170] Key generation is non-trivial. Random numbers are not good keys.

[2171] If ChipT is implemented as a core, there may be difficulties inlinking it into a given System ASIC.

[2172] If ChipT is implemented as software, not only is theimplementation of System open to programming error and non-rigoroustesting, but the integrity of the compiler and mathematics primitivesmust be rigorously checked for each implementation of System. This ismore complicated and costly than simply using a well-tested chip.

[2173] Although many symmetric algorithms are specifically strengthenedto be resistant to differential cryptanalysis (which is based on chosentext attacks), the private key K_(A) is susceptible to a chosen textattack

[2174] Protocol 4 Authentication Chips could not be exported from theUSA, since they would be considered strong encryption devices.

[2175] As with Protocol 3, the only specific timing requirement ofProtocol 4 is that the return value of 0 (indicating a bad input) mustbe produced in the same amount of time regardless of where the error isin the input. Attackers can therefore not learn anything about what wasbad about the input value. This is true for both RD and TST functions.

[2176] Variation on Call to TST

[2177] If there are two Authentication Chips used, it is theoreticallypossible for a clone manufacturer to replace the System AuthenticationChip with one that returns 1 (success) for each call to TST. The Systemcan test for this by calling TST a number of times—N times with a wronghash value, and expect the result to be 0. The final time that TST iscalled, the true returned value from ChipA is passed, and the returnvalue is trusted. The question then arises of how many times to callTST. The number of calls must be random, so that a clone chipmanufacturer cannot know the number ahead of time. If System has aclock, bits from the clock can be used to determine how many false callsto TST should be made. Otherwise the returned value from ChipA can beused. In the latter case, an attacker could still rewire the System topermit a clone ChipT to view the returned value from ChipA, and thusknow which hash value is the correct one. The worst case of course, isthat the System can be completely replaced by a clone System that doesnot require authenticated consumables—this is the limit case of rewiringand changing the System. For this reason, the variation on calls to TSTis optional, depending on the System, the Consumable, and how likelymodifications are to be made. Adding such logic to System (for examplein the case of a small desktop printer) may be considered notworthwhile, as the System is made more complicated. By contrast, addingsuch logic to a camera may be considered worthwhile.

[2178] Clone Consumable Using Real Authentication Chip

[2179] It is important to decrement the amount of consumable remainingbefore use that consumable portion. If the consumable is used first, aclone consumable could fake a loss of contact during a write to thespecial known address and then appear as a fresh new consumable. It isimportant to note that this attack still requires a real AuthenticationChip in each consumable.

[2180] Longevity of Key

[2181] A general problem of these two protocols is that once theauthentication keys are chosen, it cannot easily be changed. In someinstances a key-compromise is not a problem, while for others a keycompromise is disastrous.

[2182] Choosing a Protocol

[2183] Even if the choice of keys for Protocols 2 and 4 wasstraightforward, both protocols are impractical at the present time dueto the high cost of silicon implementation (both due to key size andfunctional implementation). Therefore Protocols 1 and 3 are the twoprotocols of choice. However, Protocols 1 and 3 contain much of the samecomponents:

[2184] both require read and write access;

[2185] both require implementation of a keyed one-way function; and

[2186] both require random number generation functionality.

[2187] Protocol 3 requires an additional key (K₂), as well as someminimal state machine changes:

[2188] a state machine alteration to enable F_(K1)[X] to be calledduring Random;

[2189] a Test function which calls F_(K2)[X]

[2190] a state machine alteration to the Read function to call F_(K1)[X]and F_(K2)[X]

[2191] Protocol 3 only requires minimal changes over Protocol 1. It ismore secure and can be used in all places where Presence OnlyAuthentication is required (Protocol 1). It is therefore the protocol ofchoice. Given that Protocols 1 and 3 both make use of keyed one-wayfunctions, the choice of one-way function is examined in more detailhere. The following table outlines the attributes of the applicablechoices. The attributes are worded so that the attribute is seen as anadvantage. Triple Random HMAC- HMAC- HMAC- DES Blowfish RC5 IDEASequences MD5 SHA1 RIPEMD160 Free of patents • • • • • • Random key • •• generation Can be exported • • • • from the USA Fast • • • • PreferredKey Size 168 128 128 128 512 128 160 160 (bits) for use in thisapplication Block size (bits) 64 64 64 64 256 512 512 512 Cryptanalysis• • • • • Attack-Free (apart from weak keys) Output size given ≧N ≧N ≧N≧N 128 128 160 160 input size N Low storage • • • • requirements Lowsilicon • • • • complexity NSA designed • •

[2192] An examination of the table shows that the choice is effectivelybetween the 3 HMAC constructs and the Random Sequence. The problem ofkey size and key generation eliminates the Random Sequence. Given that anumber of attacks have already been carried out on MD5 and since thehash result is only 128 bits, HMAC-MD5 is also eliminated. The choice istherefore between HMAC-SHA1 and HMAC-RIPEMD160. RIPEMD-160 is relativelynew, and has not been as extensively cryptanalyzed as SHA1. However,SHA-1 was designed by the NSA, so this may be seen by some as a negativeattribute. Given that there is not much between the two, SHA-1 will beused for the HMAC construct.

[2193] Choosing a Random Number Generator

[2194] Each of the protocols described (1-4) requires a random numbergenerator. The generator must be “good” in the sense that the randomnumbers generated over the life of all Systems cannot be predicted. Ifthe random numbers were the same for each System, an attacker couldeasily record the correct responses from a real Authentication Chip, andplace the responses into a ROM lookup for a clone chip. With such anattack there is no need to obtain K₁ or K₂. Therefore the random numbersfrom each System must be different enough to be unpredictable, ornon-deterministic. As such, the initial value for R (the random seed)should be programmed with a physically generated random number gatheredfrom a physically random phenomenon, one where there is no informationabout whether a particular bit will be 1 or 0. The seed for R must NOTbe generated with a computer-run random number generator. Otherwise thegenerator algorithm and seed may be compromised enabling an attacker togenerate and therefore know the set of all R values in all Systems.

[2195] Having a different R seed in each Authentication Chip means thatthe first R will be both random and unpredictable across all chips. Thequestion therefore arises of how to generate subsequent R values in eachchip. The base case is not to change R at all. Consequently R andF_(K1)[R] will be the same for each call to Random[ ]. If they are thesame, then F_(K1)[R] can be a constant rather than calculated. Anattacker could then use a single valid Authentication Chip to generate avalid lookup table, and then use that lookup table in a clone chipprogrammed especially for that System. A constant R is not secure.

[2196] The simplest conceptual method of changing R is to increment itby 1. Since R is random to begin with, the values across differingsystems are still likely to be random. However given an initial R, allsubsequent R values can be determined directly (there is no need toiterate 10,000 times—R will take on values from R₀ to R₀+10000). Anincrementing R is immune to the earlier attack on a constant R. Since Ris always different, there is no way to construct a lookup table for theparticular System without wasting as many real Authentication Chips asthe clone chip will replace.

[2197] Rather than increment using an adder, another way of changing Ris to implement it as an LFSR (Linear Feedback Shift Register). This hasthe advantage of less silicon than an adder, but the advantage of anattacker not being able to directly determine the range of R for aparticular System, since an LFSR value-domain is determined bysequential access. To determine which values an given initial R willgenerate, an attacker must iterate through the possibilities andenumerate them. The advantages of a changing R are also evident in theLFSR solution. Since R is always different, there is no way to constructa lookup table for the particular System without using-up as many realAuthentication Chips as the clone chip will replace (and only for thatSystem). There is therefore no advantage in having a more complexfunction to change R. Regardless of the function, it will always bepossible for an attacker to iterate through the lifetime set of valuesin a simulation. The primary security lies in the initial randomness ofR. Using an LFSR to change R (apart from using less silicon than anadder) simply has the advantage of not being restricted to a consecutivenumeric range (i.e. knowing R, R_(N) cannot be directly calculated; anattacker must iterate through the LFSR N times).

[2198] The Random number generator within the Authentication Chip istherefore an LFSR with 160 bits. Tap selection of the 160 bits for amaximal-period LFSR (i.e. the LFSR will cycle through all 2¹⁶⁰-1 states,0 is not a valid state) yields bits 159, 4, 2, and 1, as shown in FIG.173. The LFSR is sparse, in that not many bits are used for feedback(only 4 out of 160 bits are used). This is a problem for cryptographicapplications, but not for this application of non-sequential numbergeneration. The 160-bit seed value for R can be any random number except0, since an LFSR filled with 0s will produce a never-ending stream of0s. Since the LFSR described is a maximal period LFSR, all 160 bits canbe used directly as R. There is no need to construct a numbersequentially from output bits of b₀. After each successful call to TST,the random number (R) must be advanced by XORing bits 1, 2, 4, and 159,and shifting the result into the high order bit. The new R andcorresponding F_(K1)[R] can be retrieved on the next call to Random.

[2199] Holding out Against Logical Attacks

[2200] Protocol 3 is the authentication scheme used by theAuthentication Chip. As such, it should be resistant to defeat bylogical means. While the effect of various types of attacks on Protocol3 have been mentioned in discussion, this section details each type ofattack in turn with reference to Protocol 3.

[2201] Brute Force Attack

[2202] A Brute Force attack is guaranteed to break Protocol 3. Howeverthe length of the key means that the time for an attacker to perform abrute force attack is too long to be worth the effort. An attacker onlyneeds to break K₂ to build a clone Authentication Chip. K₁ is merelypresent to strengthen K₂ against other forms of attack. A Brute ForceAttack on K₂ must therefore break a 160-bit key. An attack against K₂requires a maximum of 2¹⁶⁰ attempts, with a 50% chance of finding thekey after only 2¹⁵⁹ attempts. Assuming an array of a trillionprocessors, each running one million tests per second, 2¹⁵⁹ (7.3×10⁴⁷)tests takes 2.3×10²³ years, which is longer than the lifetime of theuniverse. There are only 100 million personal computers in the world.Even if these were all connected in an attack (e.g. via the Internet),this number is still 10,000 times smaller than the trillion-processorattack described. Further, if the manufacture of one trillion processorsbecomes a possibility in the age of nanocomputers, the time taken toobtain the key is longer than the lifetime of the universe.

[2203] Guessing the Key Attack

[2204] It is theoretically possible that an attacker can simply “guessthe key”. In fact, given enough time, and trying every possible number,an attacker will obtain the key. This is identical to the Brute Forceattack described above, where 2¹⁵⁹ attempts must be made before a 50%chance of success is obtained. The chances of someone simply guessingthe key on the first try is 2¹⁶⁰. For comparison, the chance of someonewinning the top prize in a U.S. state lottery and being killed bylightning in the same day is only 1 in 2⁶¹. The chance of someoneguessing the Authentication Chip key on the first go is 1 in 2¹⁶⁰, whichis comparative to two people choosing exactly the same atoms from achoice of all the atoms in the Earth i.e. extremely unlikely.

[2205] Quantum Computer Attack

[2206] To break K₂, a quantum computer containing 160 qubits embedded inan appropriate algorithm must be built. An attack against a 160-bit keyis not feasible. An outside estimate of the possibility of quantumcomputers is that 50 qubits may be achievable within 50 years. Evenusing a 50 qubit quantum computer, 2¹¹⁰ tests are required to crack a160 bit key. Assuming an array of 1 billion 50 qubit quantum computers,each able to try 2⁵⁰ keys in 1 microsecond (beyond the current wildestestimates) finding the key would take an average of 18 billion years.

[2207] Cyphertext Only Attack

[2208] An attacker can launch a Cyphertext Only attack on K₁ by callingmonitoring calls to RND and RD, and on K₂ by monitoring calls to RD andTST. However, given that all these calls also reveal the plaintext aswell as the hashed form of the plaintext, the attack would betransformed into a stronger form of attack—a Known Plaintext attack.

[2209] Known Plaintext Attack

[2210] It is easy to connect a logic analyzer to the connection betweenthe System and the Authentication Chip, and thereby monitor the flow ofdata. This flow of data results in known plaintext and the hashed formof the plaintext, which can therefore be used to launch a KnownPlaintext attack against both K₁ and K₂. To launch an attack against K₁,multiple calls to RND and TST must be made (with the call to TST beingsuccessful, and therefore requiring a call to RD on a valid chip). Thisis straightforward, requiring the attacker to have both a SystemAuthentication Chip and a Consumable Authentication Chip. For each K₁ X,H_(K1)[X] pair revealed, a K₂ Y, H_(K2)[Y] pair is also revealed. Theattacker must collect these pairs for further analysis. The questionarises of how many pairs must be collected for a meaningful attack to belaunched with this data. An example of an attack that requirescollection of data for statistical analysis is DifferentialCryptanalysis. However, there are no known attacks against SHA-1 orHMAC-SHA1, so there is no use for the collected data at this time.

[2211] Chosen Plaintext Attacks

[2212] Given that the cryptanalyst has the ability to modify subsequentchosen plaintexts based upon the results of previous experiments, K₂ isopen to a partial form of the Adaptive Chosen Plaintext attack, which iscertainly a stronger form of attack than a simple Chosen Plaintextattack. A chosen plaintext attack is not possible against K₁, sincethere is no way for a caller to modify R, which used as input to the RNDfunction (the only function to provide the result of hashing with K₁).Clearing R also has the effect of clearing the keys, so is not useful,and the SSI command calls CLR before storing the new R-value.

[2213] Adaptive Chosen Plaintext Attacks

[2214] This kind of attack is not possible against K₁, since K₁ is notsusceptible to chosen plaintext attacks. However, a partial form of thisattack is possible against K₂, especially since both System andconsumables are typically available to the attacker (the System may notbe available to the attacker in some instances, such as a specific car).The HMAC construct provides security against all forms of chosenplaintext attacks. This is primarily because the HMAC construct has 2secret input variables (the result of the original hash, and the secretkey). Thus finding collisions in the hash function itself when the inputvariable is secret is even harder than finding collisions in the plainhash function. This is because the former requires direct access toSHA-1 (not permitted in Protocol 3) in order to generate pairs ofinput/output from SHA-1. The only values that can be collected by anattacker are HMAC[R] and HMAC[R|M]. These are not attacks against theSHA-1 hash function itself, and reduce the attack to a DifferentialCryptanalysis attack, examining statistical differences betweencollected data. Given that there is no Differential Cryptanalysis attackknown against SHA-1 or HMAC, Protocol 3 is resistant to the AdaptiveChosen Plaintext attacks.

[2215] Purposeful Error Attack

[2216] An attacker can only launch a Purposeful Error Attack on the TSTand RD functions, since these are the only functions that validate inputagainst the keys. With both the TST and RD functions, a 0 value isproduced if an error is found in the input—no further information isgiven. In addition, the time taken to produce the 0 result isindependent of the input, giving the attacker no information about whichbit(s) were wrong. A Purposeful Error Attack is therefore fruitless.

[2217] Chaining Attack

[2218] Any form of chaining attack assumes that the message to be hashedis over several blocks, or the input variables can somehow be set. TheHMAC-SHA1 algorithm used by Protocol 3 only ever hashes a single 512-bitblock at a time. Consequently chaining attacks are not possible againstProtocol 3.

[2219] Birthday Attack

[2220] The strongest attack known against HMAC is the birthday attack,based on the frequency of collisions for the hash function. However thisis totally impractical for minimally reasonable hash functions such asSHA-1. And the birthday attack is only possible when the attacker hascontrol over the message that is signed. Protocol 3 uses hashing as aform of digital signature. The System sends a number that must beincorporated into the response from a valid Authentication Chip. Sincethe Authentication Chip must respond with H[R|M], but has no controlover the input value R, the birthday attack is not possible. This isbecause the message has effectively already been generated and signed.An attacker must instead search for a collision message that hashes tothe same value (analogous to finding one person who shares yourbirthday). The clone chip must therefore attempt to find a new value R₂such that the hash of R₂ and a chosen M₂ yields the same hash value asH[R|M]. However the System Authentication Chip does not reveal thecorrect hash value (the TST function only returns 1 or 0 depending onwhether the hash value is correct). Therefore the only way of findingout the correct hash value (in order to find a collision) is tointerrogate a real Authentication Chip. But to find the correct valuemeans to update M, and since the decrement-only parts of M are one-way,and the read-only parts of M cannot be changed, a clone consumable wouldhave to update a real consumable before attempting to find a collision.The alternative is a Brute Force attack search on the TST function tofind a success (requiring each clone consumable to have access to aSystem consumable). A Brute Force Search, as described above, takeslonger than the lifetime of the universe, in this case, perauthentication. Due to the fact that a timely gathering of a hash valueimplies a real consumable must be decremented, there is no point for aclone consumable to launch this kind of attack.

[2221] Substitution with a Complete Lookup Table

[2222] The random number seed in each System is 160 bits. The worst casesituation for an Authentication Chip is that no state data is changed.Consequently there is a constant value returned as M. However a clonechip must still return F_(K2)[R|M], which is a 160 bit value. Assuming a160-bit lookup of a 160-bit result, this requires 7.3×10⁴⁸ bytes, or6.6×10³⁶ terabytes, certainly more space than is feasible for the nearfuture. This of course does not even take into account the method ofcollecting the values for the ROM. A complete lookup table is thereforecompletely impossible.

[2223] Substitution with a Sparse Lookup Table

[2224] A sparse lookup table is only feasible if the messages sent tothe Authentication Chip are somehow predictable, rather than effectivelyrandom. The random number R is seeded with an unknown random number,gathered from a naturally random event. There is no possibility for aclone manufacturer to know what the possible range of R is for allSystems, since each bit has a 50% chance of being a 1 or a 0. Since therange of R in all systems is unknown, it is not possible to build asparse lookup table that can be used in all systems. The general sparselookup table is therefore not a possible attack. However, it is possiblefor a clone manufacturer to know what the range of R is for a givenSystem. This can be accomplished by loading a LFSR with the currentresult from a call to a specific System Authentication Chip's RNDfunction, and iterating some number of times into the future. If this isdone, a special ROM can be built which will only contain the responsesfor that particular range of R, i.e. a ROM specifically for theconsumables of that particular System. But the attacker still needs toplace correct information in the ROM. The attacker will therefore needto find a valid Authentication Chip and call it for each of the valuesin R.

[2225] Suppose the clone Authentication Chip reports a full consumable,and then allows a single use before simulating loss of connection andinsertion of a new full consumable. The clone consumable would thereforeneed to contain responses for authentication of a full consumable andauthentication of a partially used consumable. The worst case ROMcontains entries for full and partially used consumables for R over thelifetime of System. However, a valid Authentication Chip must be used togenerate the information, and be partially used in the process. If agiven System only produces about n R-values, the sparse lookup-ROMrequired is 10 n bytes multiplied by the number of different values forM. The time taken to build the ROM depends on the amount of timeenforced between calls to RD.

[2226] After all this, the clone manufacturer must rely on the consumerreturning for a refill, since the cost of building the ROM in the firstplace consumes a single consumable. The clone manufacturer's business insuch a situation is consequently in the refills. The time and cost then,depends on the size of R and the number of different values for M thatmust be incorporated in the lookup. In addition, a custom cloneconsumable ROM must be built to match each and every System, and adifferent valid Authentication Chip must be used for each System (inorder to provide the full and partially used data). The use of anAuthentication Chip in a System must therefore be examined to determinewhether or not this kind of attack is worthwhile for a clonemanufacturer. As an example, of a camera system that has about 10,000prints in its lifetime. Assume it has a single Decrement Only value(number of prints remaining), and a delay of 1 second between calls toRD. In such a system, the sparse table will take about 3 hours to build,and consumes 100K. Remember that the construction of the ROM requiresthe consumption of a valid Authentication Chip, so any money chargedmust be worth more than a single consumable and the clone consumablecombined. Thus it is not cost effective to perform this function for asingle consumable (unless the clone consumable somehow contained theequivalent of multiple authentic consumables). If a clone manufactureris going to go to the trouble of building a custom ROM for each owner ofa System, an easier approach would be to update System to completelyignore the Authentication Chip. Consequently, this attack is possible asa per-System attack, and a decision must be made about the chance ofthis occurring for a given System/Consumable combination. The chancewill depend on the cost of the consumable and Authentication Chips, thelongevity of the consumable, the profit margin on the consumable, thetime taken to generate the ROM, the size of the resultant ROM, andwhether customers will come back to the clone manufacturer for refillsthat use the same clone chip etc.

[2227] Differential Cryptanalysis

[2228] Existing differential attacks are heavily dependent on thestructure of S boxes, as used in DES and other similar algorithms.Although other algorithms such as HMAC-SHA1 used in Protocol 3 have no Sboxes, an attacker can undertake a differential-like attack byundertaking statistical analysis of:

[2229] Minimal-difference inputs, and their corresponding outputs

[2230] Minimal-difference outputs, and their corresponding inputs

[2231] To launch an attack of this nature, sets of input/output pairsmust be collected. The collection from Protocol 3 can be via KnownPlaintext, or from a Partially Adaptive Chosen Plaintext attack.Obviously the latter, being chosen, will be more useful. Hashingalgorithms in general are designed to be resistant to differentialanalysis. SHA-1 in particular has been specifically strengthened,especially by the 80 word expansion so that minimal differences in inputproduce will still produce outputs that vary in a larger number of bitpositions (compared to 128 bit hash functions). In addition, theinformation collected is not a direct SHA-1 input/output set, due to thenature of the HMAC algorithm. The HMAC algorithm hashes a known valuewith an unknown value (the key), and the result of this hash is thenrehashed with a separate unknown value. Since the attacker does not knowthe secret value, nor the result of the first hash, the inputs andoutputs from SHA-1 are not known, making any differential attackextremely difficult. The following is a more detailed discussion ofminimally different inputs and outputs from the Authentication Chip.

[2232] Minimal Difference Inputs

[2233] This is where an attacker takes a set of X, F_(K)[X] values wherethe X values are minimally different, and examines the statisticaldifferences between the outputs F_(K)[X]. The attack relies on X valuesthat only differ by a minimal number of bits. The question then arisesas to how to obtain minimally different X values in order to compare theF_(K)[X] values.

[2234] K₁: With K₁, the attacker needs to statistically examineminimally different X, F_(K1)[X] pairs. However the attacker cannotchoose any X value and obtain a related F_(K1)[X] value. Since X,F_(K1)[X] pairs can only be generated by calling the RND function on aSystem Authentication Chip, the attacker must call RND multiple times,recording each observed pair in a table. A search must then be madethrough the observed values for enough minimally different X values toundertake a statistical analysis of the F_(K1)[X] values.

[2235] K₂: With K₂, the attacker needs to statistically examineminimally different X, F_(K2)[X] pairs. The only way of generating X,F_(K2)[X] pairs is via the RD function, which produces F_(K2)[X] for agiven Y, F_(K1)[Y] pair, where X=Y|M. This means that Y and thechangeable part of M can be chosen to a limited extent by an attacker.The amount of choice must therefore be limited as much as possible.

[2236] The first way of limiting an attacker's choice is to limit Y,since RD requires an input of the format Y, F_(K1)[Y]. Although a validpair can be readily obtained from the RND function, it is a pair ofRND's choosing. An attacker can only provide their own Y if they haveobtained the appropriate pair from RND, or if they know K₁. Obtainingthe appropriate pair from RND requires a Brute Force search. Knowing K₁is only logically possible by performing cryptanalysis on pairs obtainedfrom the RND function—effectively a known text attack. Although RND canonly be called so many times per second, K₁ is common across Systemchips. Therefore known pairs can be generated in parallel.

[2237] The second way to limit an attacker's choice is to limit M, or atleast the attacker's ability to choose M. The limiting of M is done bymaking some parts of M Read Only, yet different for each AuthenticationChip, and other parts of M Decrement Only. The Read Only parts of Mshould ideally be different for each Authentication Chip, so could beinformation such as serial numbers, batch numbers, or random numbers.The Decrement Only parts of M mean that for an attacker to try adifferent M, they can only decrement those parts of M so manytimes—after the Decrement Only parts of M have been reduced to 0 thoseparts cannot be changed again. Obtaining a new Authentication chip 53provides a new M, but the Read Only portions will be different from theprevious Authentication Chip's Read Only portions, thus reducing anattacker's ability to choose M even further. Consequently an attackercan only gain a limited number of chances at choosing values for Y andM.

[2238] Minimal Difference Outputs

[2239] This is where an attacker takes a set of X, F_(K)[X] values wherethe F_(K)[X] values are minimally different, and examines thestatistical differences between the X values. The attack relies onF_(K)[X] values that only differ by a minimal number of bits. For bothK₁ and K₂, there is no way for an attacker to generate an X value for agiven F_(K)[X]. To do so would violate the fact that F is a one-wayfunction. Consequently the only way for an attacker to mount an attackof this nature is to record all observed X, F_(K)[X] pairs in a table. Asearch must then be made through the observed values for enoughminimally different F_(K)[X] values to undertake a statistical analysisof the X values. Given that this requires more work than a minimallydifferent input attack (which is extremely limited due to therestriction on M and the choice of R), this attack is not fruitful.

[2240] Message Substitution Attacks

[2241] In order for this kind of attack to be carried out, a cloneconsumable must contain a real Authentication chip 53, but one that iseffectively reusable since it never gets decremented. The cloneAuthentication Chip would intercept messages, and substitute its own.However this attack does not give success to the attacker. A cloneAuthentication Chip may choose not to pass on a WR command to the realAuthentication Chip. However the subsequent RD command must return thecorrect response (as if the WR had succeeded). To return the correctresponse, the hash value must be known for the specific R and M. Asdescribed in the Birthday Attack section, an attacker can only determinethe hash value by actually updating M in a real Chip, which the attackerdoes not want to do. Even changing the R sent by System does not helpsince the System Authentication Chip must match the R during asubsequent TST. A Message substitution attack would therefore beunsuccessful. This is only true if System updates the amount ofconsumable remaining before it is used.

[2242] Reverse Engineering the Key Generator

[2243] If a pseudo-random number generator is used to generate keys,there is the potential for a clone manufacture to obtain the generatorprogram or to deduce the random seed used. This was the way in which theNetscape security program was initially broken.

[2244] Bypassing Authentication Altogether

[2245] Protocol 3 requires the System to update the consumable statedata before the consumable is used, and follow every write by a read (toauthenticate the write). Thus each use of the consumable requires anauthentication. If the System adheres to these two simple rules, a clonemanufacturer will have to simulate authentication via a method above(such as sparse ROM lookup).

[2246] Reuse of Authentication Chips

[2247] As described above, Protocol 3 requires the System to update theconsumable state data before the consumable is used, and follow everywrite by a read (to authenticate the write). Thus each use of theconsumable requires an authentication. If a consumable has been used up,then its Authentication Chip will have had the appropriate state-datavalues decremented to 0. The chip can therefore not be used in anotherconsumable. Note that this only holds true for Authentication Chips thathold Decrement-Only data items. If there is no state data decrementedwith each usage, there is nothing stopping the reuse of the chip. Thisis the basic difference between Presence-Only Authentication andConsumable Lifetime Authentication. Protocol 3 allows both. The bottomline is that if a consumable has Decrement Only data items that are usedby the System, the Authentication Chip cannot be reused without beingcompletely reprogrammed by a valid Programming Station that hasknowledge of the secret key.

[2248] Management Decision to Omit Authentication to Save Costs

[2249] Although not strictly an external attack, a decision to omitauthentication in future Systems in order to save costs will have widelyvarying effects on different markets. In the case of high volumeconsumables, it is essential to remember that it is very difficult tointroduce authentication after the market has started, as systemsrequiring authenticated consumables will not work with older consumablesstill in circulation. Likewise, it is impractical to discontinueauthentication at any stage, as older Systems will not work with thenew, unauthenticated, consumables. In he second case, older Systems canbe individually altered by replacing the System Authentication Chip by asimple chip that has the same programming interface, but whose TSTfunction always succeeds. Of course the System may be programmed to testfor an always-succeeding TST function, and shut down. In the case of aspecialized pairing, such as a car/car-keys, or door/door-key, or someother similar situation, the omission of authentication in futuresystems is trivial and non-repercussive. This is because the consumer issold the entire set of System and Consumable Authentication Chips at theone time.

[2250] Garrote/Bribe Attack

[2251] This form of attack is only successful in one of twocircumstances:

[2252] K₁, K₂, and R are already recorded by the chip-programmer, or

[2253] the attacker can coerce future values of K₁, K₂, and R to berecorded.

[2254] If humans or computer systems external to the Programming Stationdo not know the keys, there is no amount of force or bribery that canreveal them. The level of security against this kind of attack isultimately a decision for the System/Consumable owner, to be madeaccording to the desired level of service. For example, a car companymay wish to keep a record of all keys manufactured, so that a person canrequest a new key to be made for their car. However this allows thepotential compromise of the entire key database, allowing an attacker tomake keys for any of the manufacturer's existing cars. It does not allowan attacker to make keys for any new cars. Of course, the key databaseitself may also be encrypted with a further key that requires a certainnumber of people to combine their key portions together for access. Ifno record is kept of which key is used in a particular car, there is noway to make additional keys should one become lost. Thus an owner willhave to replace his car's Authentication Chip and all his car-keys. Thisis not necessarily a bad situation. By contrast, in a consumable such asa printer ink cartridge, the one key combination is used for all Systemsand all consumables. Certainly if no backup of the keys is kept, thereis no human with knowledge of the key, and therefore no attack ispossible. However, a no-backup situation is not desirable for aconsumable such as ink cartridges, since if the key is lost no moreconsumables can be made. The manufacturer should therefore keep a backupof the key information in several parts, where a certain number ofpeople must together combine their portions to reveal the full keyinformation. This may be required if case the chip programming stationneeds to be reloaded. In any case, none of these attacks are againstProtocol 3 itself, since no humans are involved in the authenticationprocess. Instead, it is an attack against the programming stage of thechips.

[2255] HMAC-SHA1

[2256] The mechanism for authentication is the HMAC-SHA1 algorithm,acting on one of:

[2257] HMAC-SHA1 (R, K₁), or

[2258] HMAC-SHA1 (R|M, K₂)

[2259] We will now examine the HMAC-SHA1 algorithm in greater detailthan covered so far, and describes an optimization of the algorithm thatrequires fewer memory resources than the original definition.

[2260] HMAC

[2261] The HMAC algorithm proceeds, given the following definitions:

[2262] H=the hash function (e.g. MD5 or SHA-1)

[2263] n=number of bits output from H (e.g. 160 for SHA-1, 128 bits forMD5)

[2264] M=the data to which the MAC function is to be applied

[2265] K=the secret key shared by the two parties

[2266] ipad=0x36 repeated 64 times

[2267] opad=0x5C repeated 64 times

[2268] The HMAC algorithm is as follows:

[2269] Extend K to 64 bytes by appending 0x00 bytes to the end of K

[2270] XOR the 64 byte string created in (1) with ipad

[2271] Append data stream M to the 64 byte string created in (2)

[2272] Apply H to the stream generated in (3)

[2273] XOR the 64 byte string created in (1) with opad

[2274] Append the H result from (4) to the 64 byte string resulting from(5)

[2275] Apply H to the output of (6) and output the result

[2276] Thus:

HMAC[M]=H[(K⊕opad)|H[(K⊕ipad)|M]]

[2277] HMAC-SHA1 algorithm is simply HMAC with H=SHA-1.

[2278] SHA-1

[2279] The SHA1 hashing algorithm is defined in the algorithm assummarized here.

[2280] Nine 32-bit constants are defined. There are 5 constants used toinitialize the chaining variables, and there are 4 additive constants.Initial Chaining Values Additive Constants h₁ 0x67452301 y₁ 0x5A827999h₂ 0xEFCDAB89 y₂ 0x6ED9EBA1 h₃ 0x98BADCFE y₃ 0x8F1BBCDC h₄ 0x10325476 y₄0xCA62C1D6 h₅ 0xC3D2E1F0

[2281] Non-optimized SHA-1 requires a total of 2912 bits of datastorage:

[2282] Five 32-bit chaining variables are defined: H₁, H₂, H₃, H₄ andH₅.

[2283] Five 32-bit working variables are defined: A, B, C, D, and E.

[2284] One 32-bit temporary variable is defined: t.

[2285] Eighty 32-bit temporary registers are defined: X₀₋₇₉.

[2286] The following functions are defined for SHA-1: SymbolicNomenclature Description + Addition modulo 2³² X

Y Result of rotating X left through Y bit positions f(X, Y, Z) (X

Y)

(˜X

Z) g(X, Y, Z) (X

Y)

(X

Z)

(Y

Z) h(X, Y, Z) X ⊕ Y ⊕ Z

[2287] The hashing algorithm consists of firstly padding the inputmessage to be a multiple of 512 bits and initializing the chainingvariables H₁₋₅ with h₁₋₅. The padded message is then processed in512-bit chunks, with the output hash value being the final 160-bit valuegiven by the concatenation of the chaining variables: H₁|H₂|H₃|H₄|H₅.The steps of the SHA-1 algorithm are now examined in greater detail.

[2288] Step 1. Preprocessing

[2289] The first step of SHA-1 is to pad the input message to be amultiple of 512 bits as follows and to initialize the chainingvariables. Steps to follow to preprocess the input message Pad the inputmessage Append a 1 bit to the message Append 0 bits such that the lengthof the padded message is 64-bits short of a multiple of 512 bits. Appenda 64-bit value containing the length in bits of the original inputmessage. Store the length as most significant bit through to leastsignificant bit. Initialize the chaining H₁

h₁, H₂

h₂, H₃

h₃, H₄

h₄, variables H₅

h₅

[2290] Step 2. Processing

[2291] The padded input message can now be processed. We process themessage in 512-bit blocks. Each 512-bit block is in the form of16×32-bit words, referred to as InputWord₀₋₁₅. Steps to follow for each512 bit block (InputWord₀₋₁₅) Copy the 512 input For j = 0 to 15 bitsinto X₀₋₁₅ X_(j) = InputWord_(j) Expand X₀₋₁₅ For j = 16 to 79 intoX₁₆₋₇₉ X_(j)

((X_(j-3) ⊕ X_(j-8) ⊕ X_(j-14) ⊕ X_(j-16))

1) Initialize working A

H₁, B

H₂, C

H₃, D

H₄, variables E

H₅ Round 1 For j = 0 to 19 t

((A

5) + f(B, C, D) + E + X_(j) + y₁) E

D, D

C, C

(B

30), B

A, A

t Round 2 For j = 20 to 39 t

((A

5) + h(B, C, D) + E + X_(j) + y₂) E

D, D

C, C

(B

30), B

A, A

t Round 3 For j = 40 to 59 t

((A

5) + g(B, C, D) + E + X_(j) + y₃) E

D, D

C, C

(B

30), B

A, A

t Round 4 For j = 60 to 79 t

((A

5) + h(B, C, D) + E + X_(j) + y₄) E

D, D

C, C

(B

30), B

A, A

t Update chaining H₁

H₁ + A, H₂

H₂ + B, variables H₃

H₃ + C, H₄

H₄ + D, H₅

H₅ + E

[2292] Step 3. Completion

[2293] After all the 512-bit blocks of the padded input message havebeen processed, the output hash value is the final 160-bit value givenby: H₁|H₂|H₃|H₄|H₅.

[2294] Optimization for Hardware Implementation

[2295] The SHA-1 Step 2 procedure is not optimized for hardware. Inparticular, the 80 temporary 32-bit registers use up valuable silicon ona hardware implementation. This section describes an optimization to theSHA-1 algorithm that only uses 16 temporary registers. The reduction insilicon is from 2560 bits down to 512 bits, a saving of over 2000 bits.It may not be important in some applications, but in the AuthenticationChip storage space must be reduced where possible. The optimization isbased on the fact that although the original 16-word message block isexpanded into an 80-word message block, the 80 words are not updatedduring the algorithm. In addition, the words rely on the previous 16words only, and hence the expanded words can be calculated on-the-flyduring processing, as long as we keep 16 words for the backwardreferences. We require rotating counters to keep track of which registerwe are up to using, but the effect is to save a large amount of storage.Rather than index X by a single value j, we use a 5 bit counter to countthrough the iterations. This can be achieved by initializing a 5-bitregister with either 16 or 20, and decrementing it until it reaches 0.In order to update the 16 temporary variables as if they were 80, werequire 4 indexes, each a 4-bit register. All 4 indexes increment (withwraparound) during the course of the algorithm. Steps to follow for each512 bit block (InputWord₀₋₁₅) Initialize working A

H₁, B

H₂, C

H₃, D

H₄, variables E

H₅ N₁

13, N₂

8, N₃

2, N₄

0 Round 0 Do 16 times: Copy the 512 input X_(N4) = InputWord_(N4) bitsinto X₀₋₁₅ [

N₁,

N₂,

N₃]_(optional)

N₄ Round 1A Do 16 times: t

((A

5) + f(B, C, D) + E + X_(N4) + y₁) [

N₁,

N₂,

N₃]_(optional)

N₄ E

D, D

C, C

(B

30), B

A, A

t Round 1B Do 4 times: X_(N4)

((X_(N1) ⊕ X_(N2) ⊕ X_(N3) ⊕ X_(N4))

1) t

((A

5) + f(B, C, D) + E + X_(N4) + y₁)

N₁

N₂,

N₃,

N₄ E

D, D

C, C

(B

30), B

A, A

t Round 2 Do 20 times: X_(N4)

((X_(N1) ⊕ X_(N2) ⊕ X_(N3) ⊕ X_(N4))

1) t

((A

5) + h(B, C, D) + E + X_(N4) + y₂)

N₁,

N₂,

N₃,

N₄ E

D, D

C, C

(B

30), B

A, A

t Round 3 Do 20 times: X_(N4)

((X_(N1) ⊕ X_(N2) ⊕ X_(N3) ⊕ X_(N4))

1) t

((A

5) + g(B, C, D) + E + X_(N4) + y₃)

N₁,

N₂,

N₃,

N₄ E

D, D

C, C

(B

30), B

A, A

t Round 4 Do 20 times: X_(N4)

((X_(N1) ⊕ X_(N2) ⊕ X_(N3) ⊕ X_(N4))

1) t

((A

5) + h(B, C, D) + E + X_(N4) + y₄)

N₁,

N₂,

N₃,

N₄ E

D, D

C, C

(B

30), B

A, A

t Update chaining H₁

H₁ + A, H₂

H₂ + B, variables H₃

H₃ + C, H₄

H₄ + D, H₅

H₅ + E

[2296] The incrementing of N₁, N₂, and N₃ during Rounds 0 and 1A isoptional. A software implementation would not increment them, since ittakes time, and at the end of the 16 times through the loop, all 4counters will be their original values. Designers of hardware may wishto increment all 4 counters together to save on control logic. Round 0can be completely omitted if the caller loads the 512 bits of X₀₋₁₅.

[2297] HMAC-SHA1

[2298] In the Authentication Chip implementation, the HMAC-SHA1 unitonly ever performs hashing on two types of inputs: on R using K₁ and onR|M using K₂. Since the inputs are two constant lengths, rather thanhave HMAC and SHA-1 as separate entities on chip, they can be combinedand the hardware optimized. The padding of messages in SHA-1 Step 1 (a 1bit, a string of 0 bits, and the length of the message) is necessary toensure that different messages will not look the same after padding.Since we only deal with 2 types of messages, our padding can be constant0s. In addition, the optimized version of the SHA-1 algorithm is used,where only 16 32-bit words are used for temporary storage. These 16registers are loaded directly by the optimized HMAC-SHA1 hardware. TheNine 32-bit constants h₁₋₅ and y₁₋₄ are still required, although thefact that they are constants is an advantage for hardwareimplementation. Hardware optimized HMAC-SHA-1 requires a total of 1024bits of data storage:

[2299] Five 32-bit chaining variables are defined: H₁, H₂, H₃, H₄ andH₅.

[2300] Five 32-bit working variables are defined: A, B, C, D, and E.

[2301] Five 32-bit variables for temporary storage and final result:Buff160 ₁₋₅

[2302] One 32-bit temporary variable is defined: t.

[2303] Sixteen 32-bit temporary registers are defined: X₀₋₁₅.

[2304] The following two sections describe the steps for the two typesof calls to HMAC-SHA1.

[2305] H[R, K₁]

[2306] In the case of producing the keyed hash of R using K₁, theoriginal input message R is a constant length of 160 bits. We cantherefore take advantage of this fact during processing. Rather thanload X₀₋₁₅ during the first part of the SHA-1 algorithm, we load X₀₋₁₅directly, and thereby omit Round 0 of the optimized Process Block (Step2) of SHA-1. The pseudocode takes on the following steps: StepDescription Action 1 Process K ⊕ ipad X₀₋₄

K₁ ⊕ 0x363636 . . . 2 X₅₋₁₅

0x363636 . . . 3 H₁₋₅

h₁₋₅ 4 Process Block 5 Process R X₀₋₄

R 6 X₅₋₁₅

0 7 Process Block 8 Buff160₁₋₅

H₁₋₅ 9 Process K ⊕ opad X₀₋₄

K₁ ⊕ 0x5C5C5C . . . 10 X₅₋₁₅

0x5C5C5C . . . 11 H₁₋₅

h₁₋₅ 12 Process Block 13 Process previous H[x] X₀₋₄

Result 14 X₅₋₁₅

0 15 Process Block 16 Get results Buff160₁₋₅

H₁₋₅

[2307] H[R|M, K₂]

[2308] In the case of producing the keyed hash of R|M using K₂, theoriginal input message is a constant length of 416 (256+160) bits. Wecan therefore take advantage of this fact during processing. Rather thanload X₀₋₁₅ during the first part of the SHA-1 algorithm, we load X₀₋₁₅directly, and thereby omit Round 0 of the optimized Process Block (Step2) of SHA-1. The pseudocode takes on the following steps: StepDescription Action 1 Process K ⊕ ipad X₀₋₄

K₂ ⊕ 0x363636 . . . 2 X₅₋₁₅

0x363636 . . . 3 H₁₋₅

h₁₋₅ 4 Process Block 5 Process R | M X₀₋₄

R 6 X₅₋₁₂

M 7 X₁₃₋₁₅

0 8 Process Block 9 Temp

H₁₋₅ 10 Process K ⊕ opad X₀₋₄

K₂ ⊕ 0x5C5C5C . . . 11 X₅₋₁₅

0x5C5C5C . . . 12 H₁₋₅

h₁₋₅ 13 Process Block 14 Process previous X₀₋₄

Temp H[x] 15 X₅₋₁₅

0 16 Process Block 17 Get results Result

H₁₋₅

[2309] Data Storage Integrity

[2310] Each Authentication Chip contains some non-volatile memory inorder to hold the variables required by Authentication Protocol 3. Thefollowing non-volatile variables are defined: Size (in Variable Namebits) Description M[0 . . . 15] 256 16 words (each 16 bits) containingstate data such as serial numbers, media remaining etc. K₁ 160 Key usedto transform R during authentication. K₂ 160 Key used to transform Mduring authentication. R 160 Current random number AccessMode 32 The 16sets of 2-bit AccessMode [0 . . . 15] values for M[n]. MinTicks 32 Theminimum number of clock ticks between calls to key-based functionsSIWritten 1 If set, the secret key information (K₁, K₂, and R) has beenwritten to the chip. If clear, the secret information has not beenwritten yet. IsTrusted 1 If set, the RND and TST functions can becalled, but RD and WR functions cannot be called. If clear, the RND andTST functions cannot be called, but RD and WR functions can be called.Total bits 802

[2311] Note that if these variables are in Flash memory, it is not asimple matter to write a new value to replace the old. The memory mustbe erased first, and then the appropriate bits set. This has an effecton the algorithms used to change Flash memory based variables. Forexample, Flash memory cannot easily be used as shift registers. Toupdate a Flash memory variable by a general operation, it is necessaryto follow these steps:

[2312] Read the entire N bit value into a general purpose register;

[2313] Perform the operation on the general purpose register;

[2314] Erase the Flash memory corresponding to the variable; and

[2315] Set the bits of the Flash memory location based on the bits setin the general-purpose register.

[2316] A RESET of the Authentication Chip has no effect on thesenon-volatile variables.

[2317] M and AccessMode

[2318] Variables M[0] through M[15] are used to hold consumable statedata, such as serial numbers, batch numbers, and amount of consumableremaining. Each M[n] register is 16 bits, making the entire M vector 256bits (32 bytes). Clients cannot read from or written to individual M[n]variables. Instead, the entire vector, referred to as M, is read orwritten in a single logical access. M can be read using the RD (read)command, and written to via the WR (write) command. The commands onlysucceed if K₁ and K₂ are both defined (SIWritten=1) and theAuthentication Chip is a consumable non-trusted chip (IsTrusted=0).Although M may contain a number of different data types, they differonly in their write permissions. Each data type can always be read. Oncein client memory, the 256 bits can be interpreted in any way chosen bythe client. The entire 256 bits of M are read at one time instead of insmaller amounts for reasons of security, as described in the chapterentitled Authentication. The different write permissions are outlined inthe following table: Data Type Access Note Read Only Can never bewritten to ReadWrite Can always be written to Decrement Only Can only bewritten to if the new value is less than the old value. Decrement Onlyvalues are typically 16-bit or 32-bit values, but can be any multiple of16 bits.

[2319] To accomplish the protection required for writing, a 2-bit accessmode value is defined for each M[n]. The following table defines theinterpretation of the 2-bit access mode bit-pattern: Action taken duringBits Op Interpretation Write command 00 RW ReadWrite The new 16-bitvalue is always written to M[n]. 01 MSR Decrement Only The new 16-bitvalue is only (Most written to M[n] if it is Significant less than thevalue currently Region) in M[n]. This is used for access to the MostSignificant 16 bits of a Decrement Only number. 10 NMSR Decrement OnlyThe new 16-bit value is only (Not the Most written to M[n] ifSignificant M[n + 1] can also be Region) written. The NMSR access modeallows multiple precision values of 32 bits and more (multiples of 16bits) to decrement. 11 RO Read Only The new 16-bit value is ignored.M[n] is left unchanged.

[2320] The 16 sets of access mode bits for the 16 M[n] registers aregathered together in a single 32-bit AccessMode register. The 32 bits ofthe AccessMode register correspond to M[n] with n as follows: MSB LSB 11 1 1 1 1 9 8 7 6 5 4 3 2 1 0 5 4 3 2 1 0

[2321] Each 2-bit value is stored in hi/lo format. Consequently, ifM[0-5] were access mode MSR, with M[6-15] access mode RO, the 32-bitAccessMode register would be:

[2322] 11-11-11-11-11-11-11-11-11-11-01-01-01-01-01-01

[2323] During execution of a WR (write) command, AccessMode[n] isexamined for each M[n], and a decision made as to whether the new M[n]value will replace the old. The AccessMode register is set using theAuthentication Chip's SAM (Set Access Mode) command. Note that theDecrement Only comparison is unsigned, so any Decrement Only values thatrequire negative ranges must be shifted into a positive range. Forexample, a consumable with a Decrement Only data item range of −50 to 50must have the range shifted to be 0 to 100. The System must theninterpret the range 0 to 100 as being −50 to 50. Note that mostinstances of Decrement Only ranges are N to 0, so there is no rangeshift required. For Decrement Only data items, arrange the data in orderfrom most significant to least significant 16-bit quantities from M[n]onward. The access mode for the most significant 16 bits (stored inM[n]) should be set to MSR. The remaining registers (M[n+1], M[n+2] etc)should have their access modes set to NMSR. If erroneously set to NMSR,with no associated MSR region, each NMSR region will be consideredindependently instead of being a multi-precision comparison.

[2324] K₁

[2325] K₁ is the 160-bit secret key used to transform R during theauthentication protocol. K₁ is programmed along with K₂ and R with theSSI (Set Secret Information) command. Since K₁ must be kept secret,clients cannot directly read K₁. The commands that make use of K₁ areRND and RD. RND returns a pair R, F_(K1)[R] where R is a random number,while RD requires an X, F_(K1)[X] pair as input. K₁ is used in the keyedone-way hash function HMAC-SHA1. As such it should be programmed with aphysically generated random number, gathered from a physically randomphenomenon. K₁ must NOT be generated with a computer-run random numbergenerator. The security of the Authentication chips depends on K₁, K₂and R being generated in a way that is not deterministic. For example,to set K₁, a person can toss a fair coin 160 times, recording heads as1, and tails as 0. K₁ is automatically cleared to 0 upon execution of aCLR command. It can only be programmed to a non-zero value by the SSIcommand.

[2326] K₂

[2327] K₂ is the 160-bit secret key used to transform M|R during theauthentication protocol. K₂ is programmed along with K₁ and R with theSSI (Set Secret Information) command. Since K₂ must be kept secret,clients cannot directly read K₂. The commands that make use of K₂ are RDand TST. RD returns a pair M, F_(K2)[M|X] where X was passed in as oneof the parameters to the RD function. TST requires an M, F_(K2)[M|R]pair as input, where R was obtained from the Authentication Chip's RNDfunction. K₂ is used in the keyed one-way hash function HMAC-SHA1. Assuch it should be programmed with a physically generated random number,gathered from a physically random phenomenon. K₂ must NOT be generatedwith a computer-run random number generator. The security of theAuthentication chips depends on K₁, K₂ and R being generated in a waythat is not deterministic. For example, to set K₂, a person can toss afair coin 160 times, recording heads as 1, and tails as 0. K₂ isautomatically cleared to 0 upon execution of a CLR command. It can onlybe programmed to a non-zero value by the SSI command.

[2328] R and IsTrusted

[2329] R is a 160-bit random number seed that is programmed along withK₁ and K₂ with the SSI (Set Secret Information) command. R does not haveto be kept secret, since it is given freely to callers via the RNDcommand. However R must be changed only by the Authentication Chip, andnot set to any chosen value by a caller. R is used during the TSTcommand to ensure that the R from the previous call to RND was used togenerate the F_(K2)[M|R] value in the non-trusted Authentication Chip(ChipA). Both RND and TST are only used in trusted Authentication Chips(ChipT).

[2330] IsTrusted is a 1-bit flag register that determines whether or notthe Authentication Chip is a trusted chip (ChipT):

[2331] If the IsTrusted bit is set, the chip is considered to be atrusted chip, and hence clients can call RND and TST functions (but notRD or WR).

[2332] If the IsTrusted bit is clear, the chip is not considered to betrusted. Therefore RND and TST functions cannot be called (but RD and WRfunctions can be called instead). System never needs to call RND or TSTon the consumable (since a clone chip would simply return 1 to afunction such as TST, and a constant value for RND).

[2333] The IsTrusted bit has the added advantage of reducing the numberof available R, F_(K1)[R] pairs obtainable by an attacker, yet stillmaintain the integrity of the Authentication protocol. To obtain validR, F_(K1)[R] pairs, an attacker requires a System Authentication Chip,which is more expensive and less readily available than the consumables.Both R and the IsTrusted bit are cleared to 0 by the CLR command. Theyare both written to by the issuing of the SSI command. The IsTrusted bitcan only set by storing a non-zero seed value in R via the SSI command(R must be non-zero to be a valid LFSR state, so this is quitereasonable). R is changed via a 160-bit maximal period LFSR with taps onbits 1, 2, 4, and 159, and is changed only by a successful call to TST(where 1 is returned).

[2334] Authentication Chips destined to be trusted Chips used in Systems(ChipT) should have their IsTrusted bit set during programming, andAuthentication Chips used in Consumables (ChipA) should have theirIsTrusted bit kept clear (by storing 0 in R via the SSI command duringprogramming). There is no command to read or write the IsTrusted bitdirectly. The security of the Authentication Chip does not only relyupon the randomness of K₁ and K₂ and the strength of the HMAC-SHA1algorithm. To prevent an attacker from building a sparse lookup table,the security of the Authentication Chip also depends on the range of Rover the lifetime of all Systems. What this means is that an attackermust not be able to deduce what values of R there are in produced andfuture Systems. As such R should be programmed with a physicallygenerated random number, gathered from a physically random phenomenon. Rmust NOT be generated with a computer-run random number generator. Thegeneration of R must not be deterministic. For example, to generate an Rfor use in a trusted System chip, a person can toss a fair coin 160times, recording heads as 1, and tails as 0. 0 is the only non-validinitial value for a trusted R is 0 (or the IsTrusted bit will not beset).

[2335] SIWritten

[2336] The SIWritten (Secret Information Written) 1-bit register holdsthe status of the secret information stored within the AuthenticationChip. The secret information is K₁, K₂ and R. A client cannot directlyaccess the SIWritten bit. Instead, it is cleared via the CLR command(which also clears K₁, K₂ and R). When the Authentication Chip isprogrammed with secret keys and random number seed using the SSI command(regardless of the value written), the SIWritten bit is setautomatically. Although R is strictly not secret, it must be writtentogether with K₁ and K₂ to ensure that an attacker cannot generate theirown random number seed in order to obtain chosen R, F_(K1)[R] pairs. TheSIWritten status bit is used by all functions that access K₁, K₂, or R.If the SIWritten bit is clear, then calls to RD, WR, RND, and TST areinterpreted as calls to CLR.

[2337] MinTicks

[2338] There are two mechanisms for preventing an attacker fromgenerating multiple calls to TST and RD functions in a short period oftime. The first is a clock limiting hardware component that prevents theinternal clock from operating at a speed more than a particular maximum(e.g. 10 MHz). The second mechanism is the 32-bit MinTicks register,which is used to specify the minimum number of clock ticks that mustelapse between calls to key-based functions. The MinTicks variable iscleared to 0 via the CLR command. Bits can then be set via the SMT (SetMinTicks) command. The input parameter to SMT contains the bit patternthat represents which bits of MinTicks are to be set. The practicaleffect is that an attacker can only increase the value in MinTicks(since the SMT function only sets bits). In addition, there is nofunction provided to allow a caller to read the current value of thisregister. The value of MinTicks depends on the operating clock speed andthe notion of what constitutes a reasonable time between key-basedfunction calls (application specific). The duration of a single tickdepends on the operating clock speed. This is the maximum of the inputclock speed and the Authentication Chip's clock-limiting hardware. Forexample, the Authentication Chip's clock-limiting hardware may be set at10 MHz (it is not changeable), but the input clock is 1 MHz. In thiscase, the value of 1 tick is based on 1 MHz, not 10 MHz. If the inputclock was 20 MHz instead of 1 MHz, the value of 1 tick is based on 10MHz (since the clock speed is limited to 10 MHz).

[2339] Once the duration of a tick is known, the MinTicks value can tobe set. The value for MinTicks is the minimum number of ticks requiredto pass between calls to the key-based RD and TST functions. The valueis a real-time number, and divided by the length of an operating tick.Suppose the input clock speed matches the maximum clock speed of 10 MHz.If we want a minimum of 1 second between calls to key based functions,the value for MinTicks is set to 10,000,000. Consider an attackerattempting to collect X, F_(K1)[X] pairs by calling RND, RD and TSTmultiple times. If the MinTicks value is set such that the amount oftime between calls to TST is 1 second, then each pair requires 1 secondto generate. To generate 2²⁵ pairs (only requiring 1.25 GB of storage),an attacker requires more than 1 year. An attack requiring 2⁶⁴ pairswould require 5.84×10¹¹ years using a single chip, or 584 years if 1billion chips were used, making such an attack completely impractical interms of time (not to mention the storage requirements!).

[2340] With regards to K₁, it should be noted that the MinTicks variableonly slows down an attacker and causes the attack to cost more since itdoes not stop an attacker using multiple System chips in parallel.However MinTicks does make an attack on K₂ more difficult, since eachconsumable has a different M (part of M is random read-only data). Inorder to launch a differential attack, minimally different inputs arerequired, and this can only be achieved with a single consumable(containing an effectively constant part of M). Minimally differentinputs require the attacker to use a single chip, and MinTicks causesthe use of a single chip to be slowed down. If it takes a year just toget the data to start searching for values to begin a differentialattack this increases the cost of attack and reduces the effectivemarket time of a clone consumable.

[2341] Authentication Chip Commands

[2342] The System communicates with the Authentication Chips via asimple operation command set. This section details the actual commandsand parameters necessary for implementation of Protocol 3. TheAuthentication Chip is defined here as communicating to System via aserial interface as a minimum implementation. It is a trivial matter todefine an equivalent chip that operates over a wider interface (such as8, 16 or 32 bits). Each command is defined by 3-bit opcode. Theinterpretation of the opcode can depend on the current value of theIsTrusted bit and the current value of the IsWritten bit. The followingoperations are defined: Op T W Mn Input Output Description 000 — — CLR —— Clear 001 0 0 SSI [160, 160, — Set Secret 160] Information 010 0 1 RD[160, 160] [256, 160] Read M securely 010 1 1 RND — [160, 160] Random011 0 1 WR [256] — Write M 011 1 1 TST [256, 160] [1] Test 100 0 1 SAM[32] [32] Set Access Mode 101 — 1 GIT — [1] Get Is Trusted 110 — 1 SMT[32] — Set MinTicks

[2343] Any command not defined in this table is interpreted as NOP (NoOperation). Examples include opcodes 110 and 111 (regardless ofIsTrusted or IsWritten values), and any opcode other than SSI whenIsWritten=0. Note that the opcodes for RD and RND are the same, as arethe opcodes for WR and TST. The actual command run upon receipt of theopcode will depend on the current value of the IsTrusted bit (as long asIsWritten is 1). Where the IsTrusted bit is clear, RD and WR functionswill be called. Where the IsTrusted bit is set, RND and TST functionswill be called. The two sets of commands are mutually exclusive betweentrusted and non-trusted Authentication Chips, and the same opcodesenforces this relationship. Each of the commands is examined in detailin the subsequent sections. Note that some algorithms are specificallydesigned because Flash memory is assumed for the implementation ofnon-volatile variables. CLR Clear Input None Output None Changes All

[2344] The CLR (Clear) Command is designed to completely erase thecontents of all Authentication Chip memory. This includes all keys andsecret information, access mode bits, and state data. After theexecution of the CLR command, an Authentication Chip will be in aprogrammable state, just as if it had been freshly manufactured. It canbe reprogrammed with a new key and reused. A CLR command consists ofsimply the CLR command opcode. Since the Authentication Chip is serial,this must be transferred one bit at a time. The bit order is LSB to MSBfor each command component. A CLR command is therefore sent as bits 0-2of the CLR opcode. A total of 3 bits are transferred. The CLR commandcan be called directly at any time. The order of erasure is important.SIWritten must be cleared first, to disable further calls to key accessfunctions (such as RND, TST, RD and WR). If the AccessMode bits arecleared before SIWritten, an attacker could remove power at some pointafter they have been cleared, and manipulate M, thereby have a betterchance of retrieving the secret information with a partial chosen textattack. The CLR command is implemented with the following steps: StepAction 1 Erase SIWritten Erase IsTrusted Erase K₁ Erase K₂ Erase R EraseM 2 Erase AccessMode Erase MinTicks

[2345] Once the chip has been cleared it is ready for reprogramming andreuse. A blank chip is of no use to an attacker, since although they cancreate any value for M (M can be read from and written to), key-basedfunctions will not provide any information as K₁ and K₂ will beincorrect. It is not necessary to consume any input parameter bits ifCLR is called for any opcode other than CLR. An attacker will simplyhave to RESET the chip. The reason for calling CLR is to ensure that allsecret information has been destroyed, making the chip useless to anattacker.

[2346] SSI—Set Secret Information

[2347] Input: K₁, K₂, R=[160 bits, 160 bits, 160 bits]

[2348] Output: None

[2349] Changes: K₁, K₂, R, SIWritten, IsTrusted

[2350] The SSI (Set Secret Information) command is used to load the K₁,K₂ and R variables, and to set SIWritten and IsTrusted flags for latercalls to RND, TST, RD and WR commands. An SSI command consists of theSSI command opcode followed by the secret information to be stored inthe K₁, K₂ and R registers. Since the Authentication Chip is serial,this must be transferred one bit at a time. The bit order is LSB to MSBfor each command component. An SSI command is therefore sent as: bits0-2 of the SSI opcode, followed by bits 0-159 of the new value for K₁,bits 0-159 of the new value for K₂, and finally bits 0-159 of the seedvalue for R. A total of 483 bits are transferred. The K₁, K₂, R,SIWritten, and IsTrusted registers are all cleared to 0 with a CLRcommand. They can only be set using the SSI command. The SSI commanduses the flag SIWritten to store the fact that data has been loaded intoK₁, K₂, and R. If the SIWritten and IsTrusted flags are clear (this isthe case after a CLR instruction), then K₁, K₂ and R are loaded with thenew values. If either flag is set, an attempted call to SSI results in aCLD command being executed, since only an attacker or an erroneousclient would attempt to change keys or the random seed without callingCLR first. The SSI command also sets the IsTrusted flag depending on thevalue for R. If R=0, then the chip is considered untrustworthy, andtherefore IsTrusted remains at 0. If R≠0, then the chip is consideredtrustworthy, and therefore IsTrusted is set to 1. Note that the settingof the IsTrusted bit only occurs during the SSI command. If anAuthentication Chip is to be reused, the CLR command must be calledfirst. The keys can then be safely reprogrammed with an SSI command, andfresh state information loaded into M using the SAM and WR commands. TheSSI command is implemented with the following steps: Step Action 1 CLR 2K₁

Read 160 bits from client 3 K₂

Read 160 bits from client 4 R

Read 160 bits from client 5 IF (R ≠ 0) IsTrusted

1 6 SIWritten

1

[2351] RD—Read

[2352] Input: X, F_(K1)[X]=[160 bits, 160 bits]

[2353] Output: M, F_(K2)[X|M]=[256 bits, 160 bits]

[2354] Changes: R

[2355] The RD (Read) command is used to securely read the entire 256bits of state data (M) from a non-trusted Authentication Chip. Only avalid Authentication Chip will respond correctly to the RD request. Theoutput bits from the RD command can be fed as the input bits to the TSTcommand on a trusted Authentication Chip for verification, with thefirst 256 bits (M) stored for later use if (as we hope) TST returns 1.Since the Authentication Chip is serial, the command and inputparameters must be transferred one bit at a time. The bit order is LSBto MSB for each command component. A RD command is therefore: bits 0-2of the RD opcode, followed by bits 0-159 of X, and bits 0-159 ofF_(K1)[X]. 323 bits are transferred in total. X and F_(K1)[X] areobtained by calling the trusted Authentication Chip's RND command. The320 bits output by the trusted chip's RND command can therefore be feddirectly into the non-trusted chip's RD command, with no need for thesebits to be store by System. The RD command can only be used when thefollowing conditions have been met: SIWritten = 1 indicating that K₁, K₂and R have been set up via the SSI command; and IsTrusted = 0 indicatingthe chip is not trusted since it is not permitted to generate randomnumber sequences;

[2356] In addition, calls to RD must wait for the MinTicksRemainingregister to reach 0. Once it has done so, the register is reloaded withMinTicks to ensure that a minimum time will elapse between calls to RD.Once MinTicksRemaining has been reloaded with MinTicks, the RD commandverifies that the input parameters are valid. This is accomplished byinternally generating F_(K1)[X] for the input X, and then comparing theresult against the input F_(K1)[X]. This generation and comparison musttake the same amount of time regardless of whether the input parametersare correct or not. If the times are not the same, an attacker can gaininformation about which bits of F_(K1)[X] are incorrect. The only wayfor the input parameters to be invalid is an erroneous System (passingthe wrong bits), a case of the wrong consumable in the wrong System, abad trusted chip (generating bad pairs), or an attack on theAuthentication Chip. A constant value of 0 is returned when the inputparameters are wrong. The time taken for 0 to be returned must be thesame for all bad inputs so that attackers can learn nothing about whatwas invalid. Once the input parameters have been verified the outputvalues are calculated. The 256 bit content of M are transferred in thefollowing order: bits 0-15 of M[0], bits 0-15 of M[1], through to bits0-15 of M[15]. F_(K2)[X|M] is calculated and output as bits 0-159. The Rregister is used to store the X value during the validation of the X,F_(K1)[X] pair. This is because RND and RD are mutually exclusive. TheRD command is implemented with the following steps: Step Action 1 IF(MinTicksRemaining ≠ 0 GOTO 1 2 MinTicksRemaining

MinTicks 3 R

Read 160 bits from client 4 Hash

Calculate F_(K1)[R] 5 OK

(Hash = next 160 bits from client) Note that this operation must takeconstant time so an attacker cannot determine how much of their guess iscorrect. 6 IF (OK) Output 256 bits of M to client ELSE Output 256 bitsof 0 to client 7 Hash

Calculate F_(K2)[R | M] 8 IF (OK) Output 160 bits of Hash to client ELSEOutput 160 bits of 0 to client

[2357] RND—Random Input: None Output: R, F_(K1)[R] = [160 bits, 160bits] Changes: None

[2358] The RND (Random) command is used by a client to obtain a valid R,F_(K1)[R] pair for use in a subsequent authentication via the RD and TSTcommands. Since there are no input parameters, an RND command istherefore simply bits 0-2 of the RND opcode. The RND command can only beused when the following conditions have been met: SIWritten = 1indicating K₁ and R have been set up via the SSI command; IsTrusted = 1indicating the chip is permitted to generate random number sequences;

[2359] RND returns both R and F_(K1)[R] to the caller. The 288-bitoutput of the RND command can be fed straight into the non-trustedchip's RD command as the input parameters. There is no need for theclient to store them at all, since they are not required again. Howeverthe TST command will only succeed if the random number passed into theRD command was obtained first from the RND command. If a caller onlycalls RND multiple times, the same R, F_(K1)[R] pair will be returnedeach time. R will only advance to the next random number in the sequenceafter a successful call to TST. See TST for more information. The RNDcommand is implemented with the following steps: Step Action 1 Output160 bits of R to client 2 Hash

Calculate F_(K1)[R] 3 Output 160 bits of Hash to client

[2360] TST—Test

[2361] Input: X, F_(K2)[R|X]=[256 bits, 160 bits]

[2362] Output: 1 or 0=[1 bit]

[2363] Changes: M, R and MinTicksRemaining (or all registers if attackdetected)

[2364] The TST (Test) command is used to authenticate a read of M from anon-trusted Authentication Chip. The TST (Test) command consists of theTST command opcode followed by input parameters: X and F_(K2)[R|X].Since the Authentication Chip is serial, this must be transferred onebit at a time. The bit order is LSB to MSB for each command component. ATST command is therefore: bits 0-2 of the TST opcode, followed by bits0-255 of M, bits 0-159 of F_(K2)[R|M]. 419 bits are transferred intotal. Since the last 416 input bits are obtained as the output bitsfrom a RD command to a non-trusted Authentication Chip, the entire datadoes not even have to be stored by the client. Instead, the bits can bepassed directly to the trusted Authentication Chip's TST command. Onlythe 256 bits of M should be kept from a RD command. The TST command canonly be used when the following conditions have been met: SIWritten = 1indicating K₂ and R have been set up via the SSI command; IsTrusted = 1indicating the chip is permitted to generate random number sequences;

[2365] In addition, calls to TST must wait for the MinTicksRemainingregister to reach 0. Once it has done so, the register is reloaded withMinTicks to ensure that a minimum time will elapse between calls to TST.TST causes the internal M value to be replaced by the input M value.FK₂[M|R] is then calculated, and compared against the 160 bit input hashvalue. A single output bit is produced: 1 if they are the same, and 0 ifthey are different. The use of the internal M value is to save space onchip, and is the reason why RD and TST are mutually exclusive commands.If the output bit is 1, R is updated to be the next random number in thesequence. This forces the caller to use a new random number each time RDand TST are called. The resultant output bit is not output until theentire input string has been compared, so that the time to evaluate thecomparison in the TST function is always the same. Thus no attacker cancompare execution times or number of bits processed before an output isgiven.

[2366] The next random number is generated from R using a 160-bitmaximal period LFSR (tap selections on bits 159, 4, 2, and 1). Theinitial 160-bit value for R is set up via the SSI command, and can beany random number except 0 (an LFSR filled with 0s will produce anever-ending stream of 0s). R is transformed by XORing bits 1, 2, 4, and159 together, and shifting all 160 bits right 1 bit using the XOR resultas the input bit to b₁₅₉. The new R will be returned on the next call toRND. Note that the time taken for 0 to be returned from TST must be thesame for all bad inputs so that attackers can learn nothing about whatwas invalid about the input.

[2367] The TST command is implemented with the following steps: StepAction 1 IF (MinTicksRemaining

0 GOTO 1 2 MinTicksRemaining

MinTicks 3 M

Read 256 bits from client 4 IF (R = 0) GOTO CLR 5 Hash

Calculate F_(K2)[R | M] 6 OK

(Hash = next 160 bits from client) Note that this operation must takeconstant time so an attacker cannot determine how much of their guess iscorrect. 7 IF (OK) Temp

R Erase R Advance TEMP via LFSR R

TEMP 8 Output 1 bit of OK to client

[2368] Note that we can't simply advance R directly in Step 7 since R isFlash memory, and must be erased in order for any set bit to become 0.If power is removed from the Authentication Chip during Step 7 aftererasing the old value of R, but before the new value for R has beenwritten, then R will be erased but not reprogrammed. We therefore havethe situation of IsTrusted=1, yet R=0, a situation only possible due toan attacker. Step 4 detects this event, and takes action if the attackis detected. This problem can be avoided by having a second 160-bitFlash register for R and a Validity Bit, toggled after the new value hasbeen loaded. It has not been included in this implementation for reasonsof space, but if chip space allows it, an extra 160-bit Flash registerwould be useful for this purpose.

[2369] WR—Write Input: M_(new) = [256 bits] Output: None Changes: M

[2370] A WR (Write) command is used to update the writeable parts of Mcontaining Authentication Chip state data. The WR command by itself isnot secure. It must be followed by an authenticated read of M (via a RDcommand) to ensure that the change was made as specified. The WR commandis called by passing the WR command opcode followed by the new 256 bitsof data to be written to M. Since the Authentication Chip is serial, thenew value for M must be transferred one bit at a time. The bit order isLSB to MSB for each command component. A WR command is therefore: bits0-2 of the WR opcode, followed by bits 0-15 of M[0], bits 0-15 of M[1],through to bits 0-15 of M[15]. 259 bits are transferred in total. The WRcommand can only be used when SIWritten=1, indicating that K₁, K₂ and Rhave been set up via the SSI command (if SIWritten is 0, then K₁, K₂ andR have not been setup yet, and the CLR command is called instead). Theability to write to a specific M[n] is governed by the correspondingAccess Mode bits as stored in the AccessMode register. The AccessModebits can be set using the SAM command. When writing the new value toM[n] the fact that M[n] is Flash memory must be taken into account. Allthe bits of M[n] must be erased, and then the appropriate bits set.Since these two steps occur on different cycles, it leaves thepossibility of attack open. An attacker can remove power after erasure,but before programming with the new value. However, there is noadvantage to an attacker in doing this:

[2371] A Read/Write M[n] changed to 0 by this means is of no advantagesince the attacker could have written any value using the WR commandanyway.

[2372] A Read Only M[n] changed to 0 by this means allows an additionalknown text pair (where the M[n] is 0 instead of the original value). Forfuture use M[n] values, they are already 0, so no information is given.

[2373] A Decrement Only M[n] changed to 0 simply speeds up the time inwhich the consumable is used up. It does not give any new information toan attacker that using the consumable would give.

[2374] The WR command is implemented with the following steps: StepAction  1 DecEncountered

0 EqEncountered

0 n

15  2 Temp

Read 16 bits from client  3 AM = AccessMode [˜n] Compare to the previousvalue  5 LT

(Temp < M[˜n]) [comparison is unsigned] EQ

(Temp = M[˜n])  6 WE

(AM = RW)

((AM = MSR)

LT)

((AM = NMSR)

(DecEncountered

LT))  7 DecEncountered

((AM = MSR)

LT)

((AM = NMSR)

DecEncountered)

((AM = NMSR)

EqEncountered

LT) EqEncountered

((AM = MSR)

EQ)

((AM = NMSR)

EqEncountered

EQ) Advance to the next Access Mode set and write the new M[˜n] ifapplicable  8 IF (WE) Erase M[˜n] M[˜n]

Temp 10 βn 11 IF (n ≠ 0) GOTO 2

[2375] SAM—Set AccessMode Input: AccessMode_(new) = [32 bits] Output:AccessMode = [32 bits] Changes: AccessMode

[2376] The SAM (Set Access Mode) command is used to set the 32 bits ofthe AccessMode register, and is only available for use in consumableAuthentication Chips (where the IsTrusted flag=0). The SAM command iscalled by passing the SAM command opcode followed by a 32-bit value thatis used to set bits in the AccessMode register. Since the AuthenticationChip is serial, the data must be transferred one bit at a time. The bitorder is LSB to MSB for each command component. A SAM command istherefore: bits 0-2 of the SAM opcode, followed by bits 0-31 of bits tobe set in AccessMode. 35 bits are transferred in total. The AccessModeregister is only cleared to 0 upon execution of a CLR command. Since anaccess mode of 00 indicates an access mode of RW (read/write), notsetting any AccessMode bits after a CLR means that all of M can be readfrom and written to. The SAM command only sets bits in the AccessModeregister. Consequently a client can change the access mode bits for M[n]from RW to RO (read only) by setting the appropriate bits in a 32-bitword, and calling SAM with that 32-bit value as the input parameter.This allows the programming of the access mode bits at different times,perhaps at different stages of the manufacturing process. For example,the read only random data can be written to during the initial keyprogramming stage, while allowing a second programming stage for itemssuch as consumable serial numbers.

[2377] Since the SAM command only sets bits, the effect is to allow theaccess mode bits corresponding to M[n] to progress from RW to eitherMSR, NMSR, or RO. It should be noted that an access mode of MSR can bechanged to RO, but this would not help an attacker, since theauthentication of M after a write to a doctored Authentication Chipwould detect that the write was not successful and hence abort theoperation. The setting of bits corresponds to the way that Flash memoryworks best. The only way to clear bits in the AccessMode register, forexample to change a Decrement Only M[n] to be Read/Write, is to use theCLR command. The CLR command not only erases (clears) the AccessModeregister, but also clears the keys and all of M. Thus the AccessMode[n]bits corresponding to M[n] can only usefully be changed once between CLRcommands. The SAM command returns the new value of the AccessModeregister (after the appropriate bits have been set due to the inputparameter). By calling SAM with an input parameter of 0, AccessMode willnot be changed, and therefore the current value of AccessMode will bereturned to the caller.

[2378] The SAM command is implemented with the following steps: StepAction 1 Temp

Read 32 bits from client 2 SetBits (AccessMode, Temp) 3 Output 32 bitsof AccessMode to client

[2379] GIT—Get is Trusted Input: None Output: IsTrusted = [1 bit]Changes: None

[2380] The GIT (Get Is Trusted) command is used to read the currentvalue of the IsTrusted bit on the Authentication Chip. If the bitreturned is 1, the Authentication Chip is a trusted SystemAuthentication Chip. If the bit returned is 0, the Authentication Chipis a consumable Authentication Chip. A GIT command consists of simplythe GIT command opcode. Since the Authentication Chip is serial, thismust be transferred one bit at a time. The bit order is LSB to MSB foreach command component. A GIT command is therefore sent as bits 0-2 ofthe GIT opcode. A total of 3 bits are transferred. The GIT command isimplemented with the following steps: Step Action 1 Output IsTrusted bitto client

[2381] SMT—Set MinTicks Input: MinTicks_(new) = [32 bits] Output: NoneChanges: MinTicks

[2382] The SMT (Set MinTicks) command is used to set bits in theMinTicks register and hence define the minimum number of ticks that mustpass in between calls to TST and RD. The SMT command is called bypassing the SMT command opcode followed by a 32-bit value that is usedto set bits in the MinTicks register. Since the Authentication Chip isserial, the data must be transferred one bit at a time. The bit order isLSB to MSB for each command component. An SMT command is therefore: bits0-2 of the SMT opcode, followed by bits 0-31 of bits to be set inMinTicks. 35 bits are transferred in total. The MinTicks register isonly cleared to 0 upon execution of a CLR command. A value of 0indicates that no ticks need to pass between calls to key-basedfunctions. The functions may therefore be called as frequently as theclock speed limiting hardware allows the chip to run.

[2383] Since the SMT command only sets bits, the effect is to allow aclient to set a value, and only increase the time delay if further callsare made. Setting a bit that is already set has no effect, and setting abit that is clear only serves to slow the chip down further. The settingof bits corresponds to the way that Flash memory works best. The onlyway to clear bits in the MinTicks register, for example to change avalue of 10 ticks to a value of 4 ticks, is to use the CLR command.However the CLR command clears the MinTicks register to 0 as well asclearing all keys and M. It is therefore useless for an attacker. Thusthe MinTicks register can only usefully be changed once between CLRcommands.

[2384] The SMT command is implemented with the following steps: StepAction 1 Temp

Read 32 bits from client 2 SetBits (MinTicks, Temp)

[2385] Programming Authentication Chips

[2386] Authentication Chips must be programmed with logically secureinformation in a physically secure environment. Consequently theprogramming procedures cover both logical and physical security. Logicalsecurity is the process of ensuring that K₁, K₂, R, and the random M[n]values are generated by a physically random process, and not by acomputer. It is also the process of ensuring that the order in whichparts of the chip are programmed is the most logically secure. Physicalsecurity is the process of ensuring that the programming station isphysically secure, so that K₁ and K₂ remain secret, both during the keygeneration stage and during the lifetime of the storage of the keys. Inaddition, the programming station must be resistant to physical attemptsto obtain or destroy the keys. The Authentication Chip has its ownsecurity mechanisms for ensuring that K₁ and K₂ are kept secret, but theProgramming Station must also keep K₁ and K₂ safe.

[2387] Overview

[2388] After manufacture, an Authentication Chip must be programmedbefore it can be used. In all chips values for K₁ and K₂ must beestablished. If the chip is destined to be a System Authentication Chip,the initial value for R must be determined. If the chip is destined tobe a consumable Authentication Chip, R must be set to 0, and initialvalues for M and AccessMode must be set up. The following stages aretherefore identified:

[2389] Determine Interaction between Systems and Consumables

[2390] Determine Keys for Systems and Consumables

[2391] Determine MinTicks for Systems and Consumables

[2392] Program Keys, Random Seed, MinTicks and Unused M

[2393] Program State Data and Access Modes

[2394] Once the consumable or system is no longer required, the attachedAuthentication Chip can be reused. This is easily accomplished byreprogrammed the chip starting at Stage 4 again. Each of the stages isexamined in the subsequent sections.

[2395] Stage 0: Manufacture

[2396] The manufacture of Authentication Chips does not require anyspecial security. There is no secret information programmed into thechips at manufacturing stage. The algorithms and chip process is notspecial. Standard Flash processes are used. A theft of AuthenticationChips between the chip manufacturer and programming station would onlyprovide the clone manufacturer with blank chips. This merely compromisesthe sale of Authentication chips, not anything authenticated byAuthentication Chips. Since the programming station is the onlymechanism with consumable and system product keys, a clone manufacturerwould not be able to program the chips with the correct key. Clonemanufacturers would be able to program the blank chips for their ownsystems and consumables, but it would be difficult to place these itemson the market without detection. In addition, a single theft would bedifficult to base a business around.

[2397] Stage 1: Determine Interaction Between Systems and Consumables

[2398] The decision of what is a System and what is a Consumable needsto be determined before any Authentication Chips can be programmed. Adecision needs to be made about which Consumables can be used in whichSystems, since all connected Systems and Consumables must share the samekey information. They also need to share state-data usage mechanismseven if some of the interpretations of that data have not yet beendetermined. A simple example is that of a car and car-keys. The caritself is the System, and the car-keys are the consumables. There areseveral car-keys for each car, each containing the same key informationas the specific car. However each car (System) would contain a differentkey (shared by its car-keys), since we don't want car-keys from one carworking in another. Another example is that of a photocopier thatrequires a particular toner cartridge. In simple terms the photocopieris the System, and the toner cartridge is the consumable. However thedecision must be made as to what compatibility there is to be betweencartridges and photocopiers. The decision has historically been made interms of the physical packaging of the toner cartridge: certaincartridges will or won't fit in a new model photocopier based on thedesign decisions for that copier. When Authentication Chips are used,the components that must work together must share the same keyinformation.

[2399] In addition, each type of consumable requires a different way ofdividing M (the state data). Although the way in which M is used willvary from application to application, the method of allocating M[n] andAccessMode[n] will be the same:

[2400] Define the consumable state data for specific use

[2401] Set some M[n] registers aside for future use (if required). Setthese to be 0 and Read Only. The value can be tested for in Systems tomaintain compatibility.

[2402] Set the remaining M[n] registers (at least one, but it does nothave to be M[15]) to be Read Only, with the contents of each M[n]completely random. This is to make it more difficult for a clonemanufacturer to attack the authentication keys.

[2403] The following examples show ways in which the state data may beorganized.

EXAMPLE 1

[2404] Suppose we have a car with associated car-keys. A 16-bit keynumber is more than enough to uniquely identify each car-key for a givencar. The 256 bits of M could be divided up as follows: M[n] AccessDescription 0 RO Key number (16 bits) 1-4 RO Car engine number (64 bits)5-8 RO For future expansion = 0 (64 bits)  8-15 RO Random bit data (128bits)

[2405] If the car manufacturer keeps all logical keys for all cars, itis a trivial matter to manufacture a new physical car-key for a givencar should one be lost. The new car-key would contain a new Key Numberin M[0], but have the same K₁ and K₂ as the car's Authentication Chip.Car Systems could allow specific key numbers to be invalidated (forexample if a key is lost). Such a system might require Key 0 (the masterkey) to be inserted first, then all valid keys, then Key 0 again. Onlythose valid keys would now work with the car. In the worst case, forexample if all car-keys are lost, then a new set of logical keys couldbe generated for the car and its associated physical car-keys ifdesired. The Car engine number would be used to tie the key to theparticular car. Future use data may include such things as rentalinformation, such as driver/renter details.

EXAMPLE 2

[2406] Suppose we have a photocopier image unit which should be replacedevery 100,000 copies. 32 bits are required to store the number of pagesremaining. The 256 bits of M could be divided up as follows: M[n] AccessDescription 0 RO Serial number (16 bits) 1 RO Batch number (16 bits) 2MSR Page Count Remaining (32 bits, hi/lo) 3 NMSR 4-7 RO For futureexpansion = 0 (64 bits)  8-15 RO Random bit data (128 bits)

[2407] If a lower quality image unit is made that must be replaced afteronly 10,000 copies, the 32-bit page count can still be used forcompatibility with existing photocopiers. This allows several consumabletypes to be used with the same system.

EXAMPLE 3

[2408] Consider a Polaroid camera consumable containing 25 photos. A16-bit countdown is all that is required to store the number of photosremaining. The 256 bits of M could be divided up as follows: M[n] AccessDescription 0 RO Serial number (16 bits) 1 RO Batch number (16 bits) 2MSR Photos Remaining (16 bits) 3-6 RO For future expansion = 0 (64 bits) 7-15 RO Random bit data (144 bits)

[2409] The Photos Remaining value at M[2] allows a number of consumabletypes to be built for use with the same camera System. For example, anew consumable with 36 photos is trivial to program. Suppose 2 yearsafter the introduction of the camera, a new type of camera wasintroduced. It is able to use the old consumable, but also can process anew film type. M[3] can be used to define Film Type. Old film typeswould be 0, and the new film types would be some new value. New Systemscan take advantage of this. Original systems would detect a non-zerovalue at M[3] and realize incompatibility with new film types. NewSystems would understand the value of M[3] and so react appropriately.To maintain compatibility with the old consumable, the new consumableand System needs to have the same key information as the old one. Tomake a clean break with a new System and its own special consumables, anew key set would be required.

EXAMPLE 4

[2410] Consider a printer consumable containing 3 inks: cyan, magenta,and yellow. Each ink amount can be decremented separately. The 256 bitsof M could be divided up as follows: M[n] Access Description 0 RO Serialnumber (16 bits) 1 RO Batch number (16 bits) 2 MSR Cyan Remaining (32bits, hi/lo) 3 NMSR 4 MSR Magenta Remaining (32 bits, hi/lo) 5 NMSR 6MSR Yellow Remaining (32 bits, hi/lo) 7 NMSR  8-11 RO For futureexpansion = 0 (64 bits) 12-15 RO Random bit data (64 bits)

[2411] Stage 2: Determine Keys for Systems and Consumables

[2412] Once the decision has been made as to which Systems andconsumables are to share the same keys, those keys must be defined. Thevalues for K₁ and K₂ must therefore be determined. In most cases, K₁ andK₂ will be generated once for all time. All Systems and consumables thathave to work together (both now and in the future) need to have the sameK₁ and K₂ values. K₁ and K₂ must therefore be kept secret since theentire security mechanism for the System/Consumable combination is madevoid if the keys are compromised. If the keys are compromised, thedamage depends on the number of systems and consumables, and the ease towhich they can be reprogrammed with new non-compromised keys: In thecase of a photocopier with toner cartridges, the worst case is that aclone manufacturer could then manufacture their own Authentication Chips(or worse, buy them), program the chips with the known keys, and theninsert them into their own consumables. In the case of a car withcar-keys, each car has a different set of keys. This leads to twopossible general scenarios. The first is that after the car and car-keysare programmed with the keys, K₁ and K₂ are deleted so no record oftheir values are kept, meaning that there is no way to compromise K₁ andK₂. However no more car-keys can be made for that car withoutreprogramming the car's Authentication Chip. The second scenario is thatthe car manufacturer keeps K₁ and K₂, and new keys can be made for thecar. A compromise of K₁ and K₂ means that someone could make a car-keyspecifically for a particular car.

[2413] The keys and random data used in the Authentication Chips musttherefore be generated by a means that is non-deterministic (acompletely computer generated pseudo-random number cannot be usedbecause it is deterministic—knowledge of the generator's seed gives allfuture numbers). K₁ and K₂ should be generated by a physically randomprocess, and not by a computer. However, random bit generators based onnatural sources of randomness are subject to influence by externalfactors and also to malfunction. It is imperative that such devices betested periodically for statistical randomness.

[2414] A simple yet useful source of random numbers is the Lavarand®system from SGI. This generator uses a digital camera to photograph sixlava lamps every few minutes. Lava lamps contain chaotic turbulentsystems. The resultant digital images are fed into an SHA-1implementation that produces a 7-way hash, resulting in a 160-bit valuefrom every 7th bye from the digitized image. These 7 sets of 160 bitstotal 140 bytes. The 140 byte value is fed into a BBS generator toposition the start of the output bitstream. The output 160 bits from theBBS would be the key or the Authentication chip 53. An extreme exampleof a non-deterministic random process is someone flipping a coin 160times for K₁ and 160 times for K₂ in a clean room. With each head ortail, a 1 or 0 is entered on a panel of a Key Programmer Device. Theprocess must be undertaken with several observers (for verification) insilence (someone may have a hidden microphone). The point to be made isthat secure data entry and storage is not as simple as it sounds. Thephysical security of the Key Programmer Device and accompanyingProgramming Station requires an entire document of its own. Once keys K₁and K₂ have been determined, they must be kept for as long asAuthentication Chips need to be made that use the key. In the firstcar/car-key scenario K₁ and K₂ are destroyed after a single System chipand a few consumable chips have been programmed. In the case of thephotocopier/toner cartridge, K₁ and K₂ must be retained for as long asthe toner-cartridges are being made for the photocopiers. The keys mustbe kept securely.

[2415] Stage 3: Determine MinTicks for Systems and Consumables

[2416] The value of MinTicks depends on the operating clock speed of theAuthentication Chip (System specific) and the notion of what constitutesa reasonable time between RD or TST function calls (applicationspecific). The duration of a single tick depends on the operating clockspeed. This is the maximum of the input clock speed and theAuthentication Chip's clock-limiting hardware. For example, theAuthentication Chip's clock-limiting hardware may be set at 10 MHz (itis not changeable), but the input clock is 1 MHz. In this case, thevalue of 1 tick is based on 1 MHz, not 10 MHz. If the input clock was 20MHz instead of 1 MHz, the value of 1 tick is based on 10 MHz (since theclock speed is limited to 10 MHz). Once the duration of a tick is known,the MinTicks value can be set. The value for MinTicks is the minimumnumber of ticks required to pass between calls to RD or RND key-basedfunctions. Suppose the input clock speed matches the maximum clock speedof 10 MHz. If we want a minimum of 1 second between calls to TST, thevalue for MinTicks is set to 10,000,000. Even a value such as 2 secondsmight be a completely reasonable value for a System such as a printer(one authentication per page, and one page produced every 2 or 3seconds).

[2417] Stage 4: Program Keys, Random Seed, MinTicks and Unused M

[2418] Authentication Chips are in an unknown state after manufacture.Alternatively, they have already been used in one consumable, and mustbe reprogrammed for use in another. Each Authentication Chip must becleared and programmed with new keys and new state data. Clearing andsubsequent programming of Authentication Chips must take place in asecure Programming Station environment.

[2419] Programming a Trusted System Authentication Chip

[2420] If the chip is to be a trusted System chip, a seed value for Rmust be generated. It must be a random number derived from a physicallyrandom process, and must not be 0. The following tasks must beundertaken, in the following order, and in a secure programmingenvironment:

[2421] RESET the chip

[2422] CLR[ ]

[2423] Load R (160 bit register) with physically random data

[2424] SSI[K₁, K₂, R]

[2425] SMT [MinTicks_(System)]

[2426] The Authentication Chip is now ready for insertion into a System.It has been completely programmed. If the System Authentication Chipsare stolen at this point, a clone manufacturer could use them togenerate R, F_(K1)[R] pairs in order to launch a known text attack onK₁, or to use for launching a partially chosen-text attack on K₂. Thisis no different to the purchase of a number of Systems, each containinga trusted Authentication Chip. The security relies on the strength ofthe Authentication protocols and the randomness of K₁ and K₂.

[2427] Programming a Non-Trusted Consumable Authentication Chip

[2428] If the chip is to be a non-trusted Consumable AuthenticationChip, the programming is slightly different to that of the trustedSystem Authentication Chip. Firstly, the seed value for R must be 0. Itmust have additional programming for M and the AccessMode values. Thefuture use M[n] must be programmed with 0, and the random M[n] must beprogrammed with random data. The following tasks must be undertaken, inthe following order, and in a secure programming environment:

[2429] RESET the chip

[2430] CLR[ ]

[2431] Load R (160 bit register) with 0

[2432] SSI[K₁, K₂, R]

[2433] Load X (256 bit register) with 0

[2434] Set bits in X corresponding to appropriate M[n] with physicallyrandom data

[2435] WR[X]

[2436] Load Y (32 bit register) with 0

[2437] Set bits in Y corresponding to appropriate M[n] with Read OnlyAccess Modes

[2438] SAM[Y]

[2439] SMT [MinTicks_(Consumable)]

[2440] The non-trusted consumable chip is now ready to be programmedwith the general state data. If the Authentication Chips are stolen atthis point, an attacker could perform a limited chosen text attack. Inthe best situation, parts of M are Read Only (0 and random data), withthe remainder of M completely chosen by an attacker (via the WRcommand). A number of RD calls by an attacker obtains F_(K2)[M|R] for alimited M. In the worst situation, M can be completely chosen by anattacker (since all 256 bits are used for state data). In both caseshowever, the attacker cannot choose any value for R since it is suppliedby calls to RND from a System Authentication Chip. The only way toobtain a chosen R is by a Brute Force attack. It should be noted that ifStages 4 and 5 are carried out on the same Programming Station (thepreferred and ideal situation), Authentication Chips cannot be removedin between the stages. Hence there is no possibility of theAuthentication Chips being stolen at this point. The decision to programthe Authentication Chips at one or two times depends on the requirementsof the System/Consumable manufacturer.

[2441] Stage 5: Program State Data and Access Modes

[2442] This stage is only required for consumable Authentication Chips,since M and AccessMode registers cannot be altered on SystemAuthentication Chips. The future use and random values of M[n] havealready been programmed in Stage 4. The remaining state data values needto be programmed and the associated Access Mode values need to be set.Bear in mind that the speed of this stage will be limited by the valuestored in the MinTicks register. This stage is separated from Stage 4 onaccount of the differences either in physical location or in timebetween where/when Stage 4 is performed, and where/when Stage 5 isperformed. Ideally, Stages 4 and 5 are performed at the same time in thesame Programming Station. Stage 4 produces valid Authentication Chips,but does not load them with initial state values (other than 0). This isto allow the programming of the chips to coincide with production lineruns of consumables. Although Stage 5 can be run multiple times, eachtime setting a different state data value and Access Mode value, it ismore likely to be run a single time, setting all the remaining statedata values and setting all the remaining Access Mode values. Forexample, a production line can be set up where the batch number andserial number of the Authentication Chip is produced according to thephysical consumable being produced. This is much harder to match if thestate data is loaded at a physically different factory.

[2443] The Stage 5 process involves first checking to ensure the chip isa valid consumable chip, which includes a RD to gather the data from theAuthentication Chip, followed by a WR of the initial data values, andthen a SAM to permanently set the new data values. The steps areoutlined here:

[2444] IsTrusted=GIT[ ]

[2445] If (IsTrusted), exit with error (wrong kind of chip!)

[2446] Call RND on a valid System chip to get a valid input pair

[2447] Call RD on chip to be programmed, passing in valid input pair

[2448] Load X (256 bit register) with results from a RD ofAuthentication Chip

[2449] Call TST on valid System chip to ensure X and consumable chip arevalid

[2450] If (TST returns 0), exit with error (wrong consumable chip forsystem)

[2451] Set bits of X to initial state values

[2452] WR[X]

[2453] Load Y (32 bit register) with 0

[2454] Set bits of Y corresponding to Access Modes for new state values

[2455] SAM[Y]

[2456] Of course the validation (Steps 1 to 7) does not have to occur ifStage 4 and 5 follow on from one another on the same ProgrammingStation. But it should occur in all other situations where Stage 5 isrun as a separate programming process from Stage 4. If theseAuthentication Chips are now stolen, they are already programmed for usein a particular consumable. An attacker could place the stolen chipsinto a clone consumable. Such a theft would limit the number of clonedproducts to the number of chips stolen. A single theft should not createa supply constant enough to provide clone manufacturers with acost-effective business. The alternative use for the chips is to savethe attacker from purchasing the same number of consumables, each withan Authentication Chip, in order to launch a partially chosen textattack or brute force attack. There is no special security breach of thekeys if such an attack were to occur.

[2457] Manufacture

[2458] The circuitry of the Authentication Chip must be resistant tophysical attack. A summary of manufacturing implementation guidelines ispresented, followed by specification of the chip's physical defenses(ordered by attack).

[2459] Guidelines for Manufacturing

[2460] The following are general guidelines for implementation of anAuthentication Chip in terms of manufacture:

[2461] Standard process

[2462] Minimum size (if possible)

[2463] Clock Filter

[2464] Noise Generator

[2465] Tamper Prevention and Detection circuitry

[2466] Protected memory with tamper detection

[2467] Boot circuitry for loading program code

[2468] Special implementation of FETs for key data paths

[2469] Data connections in polysilicon layers where possible

[2470] OverUnderPower Detection Unit

[2471] No test circuitry

[2472] Standard Process

[2473] The Authentication Chip should be implemented with a standardmanufacturing process (such as Flash). This is necessary to:

[2474] Allow a great range of manufacturing location options

[2475] Take advantage of well-defined and well-known technology

[2476] Reduce cost

[2477] Note that the standard process still allows physical protectionmechanisms.

[2478] Minimum Size

[2479] The Authentication chip 53 must have a low manufacturing cost inorder to be included as the authentication mechanism for low costconsumables. It is therefore desirable to keep the chip size as low asreasonably possible. Each Authentication Chip requires 802 bits ofnon-volatile memory. In addition, the storage required for optimizedHMAC-SHA1 is 1024 bits. The remainder of the chip (state machine,processor, CPU or whatever is chosen to implement Protocol 3) must bekept to a minimum in order that the number of transistors is minimizedand thus the cost per chip is minimized. The circuit areas that processthe secret key information or could reveal information about the keyshould also be minimized (see Non-Flashing CMOS below for special datapaths).

[2480] Clock Filter

[2481] The Authentication Chip circuitry is designed to operate within aspecific clock speed range. Since the user directly supplies the clocksignal, it is possible for an attacker to attempt to introducerace-conditions in the circuitry at specific times during processing. Anexample of this is where a high clock speed (higher than the circuitryis designed for) may prevent an XOR from working properly, and of thetwo inputs, the first may always be returned. These styles of transientfault attacks can be very efficient at recovering secret keyinformation. The lesson to be learned from this is that the input clocksignal cannot be trusted. Since the input clock signal cannot betrusted, it must be limited to operate up to a maximum frequency. Thiscan be achieved a number of ways. One way to filter the clock signal isto use an edge detect unit passing the edge on to a delay, which in turnenables the input clock signal to pass through. FIG. 174 shows clocksignal flow within the Clock Filter. The delay should be set so that themaximum clock speed is a particular frequency (e.g. about 4 MHz). Notethat this delay is not programmable—it is fixed. The filtered clocksignal would be further divided internally as required.

[2482] Noise Generator

[2483] Each Authentication Chip should contain a noise generator thatgenerates continuous circuit noise. The noise will interfere with otherelectromagnetic emissions from the chip's regular activities and addnoise to the I_(dd) signal. Placement of the noise generator is not anissue on an Authentication Chip due to the length of the emissionwavelengths. The noise generator is used to generate electronic noise,multiple state changes each clock cycle, and as a source ofpseudo-random bits for the Tamper Prevention and Detection circuitry. Asimple implementation of a noise generator is a 64-bit LFSR seeded witha non-zero number. The clock used for the noise generator should berunning at the maximum clock rate for the chip in order to generate asmuch noise as possible.

[2484] Tamper Prevention and Detection Circuitry

[2485] A set of circuits is required to test for and prevent physicalattacks on the Authentication Chip. However what is actually detected asan attack may not be an intentional physical attack. It is thereforeimportant to distinguish between these two types of attacks in anAuthentication Chip:

[2486] where you can be certain that a physical attack has occurred.

[2487] where you cannot be certain that a physical attack has occurred.

[2488] The two types of detection differ in what is performed as aresult of the. detection. In the first case, where the circuitry can becertain that a true physical attack has occurred, erasure of Flashmemory key information is a sensible action. In the second case, wherethe circuitry cannot be sure if an attack has occurred, there is stillcertainly something wrong. Action must be taken, but the action shouldnot be the erasure of secret key information. A suitable action to takein the second case is a chip RESET. If what was detected was an attackthat has permanently damaged the chip, the same conditions will occurnext time and the chip will RESET again. If, on the other hand, what wasdetected was part of the normal operating environment of the chip, aRESET will not harm the key.

[2489] A good example of an event that circuitry cannot have knowledgeabout, is a power glitch. The glitch may be an intentional attack,attempting to reveal information about the key. It may, however, be theresult of a faulty connection, or simply the start of a power-downsequence. It is therefore best to only RESET the chip, and not erase thekey. If the chip was powering down, nothing is lost. If the System isfaulty, repeated RESETs will cause the consumer to get the Systemrepaired. In both cases the consumable is still intact.A good example ofan event that circuitry can have knowledge about, is the cutting of adata line within the chip. If this attack is somehow detected, it couldonly be a result of a faulty chip (manufacturing defect) or an attack.In either case, the erasure of the secret information is a sensible stepto take.

[2490] Consequently each Authentication Chip should have 2 TamperDetection Lines as illustrated in Fig.—one for definite attacks, and onefor possible attacks. Connected to these Tamper Detection Lines would bea number of Tamper Detection test units, each testing for differentforms of tampering. In addition, we want to ensure that the TamperDetection Lines and Circuits themselves cannot also be tampered with.

[2491] At one end of the Tamper Detection Line is a source ofpseudo-random bits (clocking at high speed compared to the generaloperating circuitry). The Noise Generator circuit described above is anadequate source. The generated bits pass through two different paths—onecarries the original data, and the other carries the inverse of thedata. The wires carrying these bits are in the layer above the generalchip circuitry (for example, the memory, the key manipulation circuitryetc). The wires must also cover the random bit generator. The bits arerecombined at a number of places via an XOR gate. If the bits aredifferent (they should be), a 1 is output, and used by the particularunit (for example, each output bit from a memory read should be ANDedwith this bit value). The lines finally come together at the Flashmemory Erase circuit, where a complete erasure is triggered by a 0 fromthe XOR. Attached to the line is a number of triggers, each detecting aphysical attack on the chip. Each trigger has an oversize nMOStransistor attached to GND. The Tamper Detection Line physically goesthrough this nMOS transistor. If the test fails, the trigger causes theTamper Detect Line to become 0. The XOR test will therefore fail oneither this clock cycle or the next one (on average), thus RESETing orerasing the chip. FIG. 175 illustrates the basic principle of a TamperDetection Line in terms of tests and the XOR connected to either theErase or RESET circuitry.

[2492] The Tamper Detection Line must go through the drain of an outputtransistor for each test, as illustrated by the oversize nMOS transistorlayout of FIG. 176.: It is not possible to break the Tamper Detect Linesince this would stop the flow of 1s and 0s from the random source. TheXOR tests would therefore fail. As the Tamper Detect Line physicallypasses through each test, it is not possible to eliminate any particulartest without breaking the Tamper Detect Line. It is important that theXORs take values from a variety of places along the Tamper Detect Linesin order to reduce the chances of an attack. FIG. 177 illustrates thetaking of multiple XORs from the Tamper Detect Line to be used in thedifferent parts of the chip. Each of these XORs can be considered to begenerating a ChipOK bit that can be used within each unit or sub-unit.

[2493] A sample usage would be to have an OK bit in each unit that isANDed with a given ChipOK bit each cycle. The OK bit is loaded with 1 ona RESET. If OK is 0, that unit will fail until the next RESET. If theTamper Detect Line is functioning correctly, the chip will either RESETor erase all key information. If the RESET or erase circuitry has beendestroyed, then this unit will not function, thus thwarting an attacker.The destination of the RESET and Erase line and associated circuitry isvery context sensitive. It needs to be protected in much the same way asthe individual tamper tests. There is no point generating a RESET pulseif the attacker can simply cut the wire leading to the RESET circuitry.The actual implementation will depend very much on what is to be clearedat RESET, and how those items are cleared. Finally, FIG. 178 shows howthe Tamper Lines cover the noise generator circuitry of the chip. Thegenerator and NOT gate are on one level, while the Tamper Detect Linesrun on a level above the generator.

[2494] Protected Memory with Tamper Detection

[2495] It is not enough to simply store secret information or programcode in Flash memory. The Flash memory and RAM must be protected from anattacker who would attempt to modify (or set) a particular bit ofprogram code or key information. The mechanism used must conform tobeing used in the Tamper Detection Circuitry (described above). Thefirst part of the solution is to ensure that the Tamper Detection Linepasses directly above each Flash or RAM bit. This ensures that anattacker cannot probe the contents of Flash or RAM. A breach of thecovering wire is a break in the Tamper Detection Line. The breach causesthe Erase signal to be set, thus deleting any contents of the memory.The high frequency noise on the Tamper Detection Line also obscurespassive observation.

[2496] The second part of the solution for Flash is to use multi-leveldata storage, but only to use a subset of those multiple levels forvalid bit representations. Normally, when multi-level Flash storage isused, a single floating gate holds more than one bit. For example, a4-voltage-state transistor can represent two bits. Assuming a minimumand maximum voltage representing 00 and 11 respectively, the two middlevoltages represent 01 and 10. In the Authentication Chip, we can use thetwo middle voltages to represent a single bit, and consider the twoextremes to be invalid states. If an attacker attempts to force thestate of a bit one way or the other by closing or cutting the gate'scircuit, an invalid voltage (and hence invalid state) results.

[2497] The second part of the solution for RAM is to use a parity bit.The data part of the register can be checked against the parity bit(which will not match after an attack). The bits coming from Flash andRAM can therefore be validated by a number of test units (one per bit)connected to the common Tamper Detection Line. The Tamper Detectioncircuitry would be the first circuitry the data passes through (thusstopping an attacker from cutting the data lines).

[2498] Boot Circuitry for Loading Program Code

[2499] Program code should be kept in multi-level Flash instead of ROM,since ROM is subject to being altered in a non-testable way. A bootmechanism is therefore required to load the program code into Flashmemory (Flash memory is in an indeterminate state after manufacture).The boot circuitry must not be in ROM—a small state-machine wouldsuffice. Otherwise the boot code could be modified in an undetectableway. The boot circuitry must erase all Flash memory, check to ensure theerasure worked, and then load the program code. Flash memory must beerased before loading the program code. Otherwise an attacker could putthe chip into the boot state, and then load program code that simplyextracted the existing keys. The state machine must also check to ensurethat all Flash memory has been cleared (to ensure that an attacker hasnot cut the Erase line) before loading the new program code. The loadingof program code must be undertaken by the secure Programming Stationbefore secret information (such as keys) can be loaded.

[2500] Special Implementation of FETs for Key Data Paths

[2501] The normal situation for FET implementation for the case of aCMOS Inverter (which involves a pMOS transistor combined with an nMOStransistor) is shown in FIG. 179. During the transition, there is asmall period of time where both the nMOS transistor and the pMOStransistor have an intermediate resistance. The resultant power-groundshort circuit causes a temporary increase in the current, and in factaccounts for the majority of current consumed by a CMOS device. A smallamount of infrared light is emitted during the short circuit, and can beviewed through the silicon substrate (silicon is transparent to infraredlight). A small amount of light is also emitted during the charging anddischarging of the transistor gate capacitance and transmission linecapacitance.

[2502] For circuitry that manipulates secret key information, suchinformation must be kept hidden. An alternative non-flashing CMOSimplementation should therefore be used for all data paths thatmanipulate the key or a partially calculated value that is based on thekey. The use of two non-overlapping clocks f1 and f2 can provide anon-flashing mechanism. f1 is connected to a second gate of all nMOStransistors, and f2 is connected to a second gate of all pMOStransistors. The transition can only take place in combination with theclock. Since f1 and f2 are non-overlapping, the pMOS and nMOStransistors will not have a simultaneous intermediate resistance. Thesetup is shown in FIG. 180.

[2503] Finally, regular CMOS inverters can be positioned near criticalnon-Flashing CMOS components. These inverters should take their inputsignal from the Tamper Detection Line above. Since the Tamper DetectionLine operates multiple times faster than the regular operatingcircuitry, the net effect will be a high rate of light-bursts next toeach non-Flashing CMOS component. Since a bright light overwhelmsobservation of a nearby faint light, an observer will not be able todetect what switching operations are occurring in the chip proper. Theseregular CMOS inverters will also effectively increase the amount ofcircuit noise, reducing the SNR and obscuring useful EMI.

[2504] There are a number of side effects due to the use of non-FlashingCMOS:

[2505] The effective speed of the chip is reduced by twice the rise timeof the clock per clock cycle. This is not a problem for anAuthentication Chip.

[2506] The amount of current drawn by the non-Flashing CMOS is reduced(since the short circuits do not occur). However, this is offset by theuse of regular CMOS inverters.

[2507] Routing of the clocks increases chip area, especially sincemultiple versions of f1 and f2 are required to cater for differentlevels of propagation. The estimation of chip area is double that of aregular implementation.

[2508] Design of the non-Flashing areas of the Authentication Chip areslightly more complex than to do the same with a with a regular CMOSdesign. In particular, standard cell components cannot be used, makingthese areas full custom. This is not a problem for something as small asan Authentication Chip, particularly when the entire chip does not haveto be protected in this manner.

[2509] Connections in Polysilicon Layers where Possible

[2510] Wherever possible, the connections along which the key or secretdata flows, should be made in the polysilicon layers. Where necessary,they can be in metal 1, but must never be in the top metal layer(containing the Tamper Detection Lines).

[2511] OverUnderPower Detection Unit

[2512] Each Authentication Chip requires an OverUnderPower DetectionUnit to prevent Power Supply Attacks. An OverUnderPower Detection Unitdetects power glitches and tests the power level against a VoltageReference to ensure it is within a certain tolerance. The Unit containsa single Voltage Reference and two comparators. The OverUnderPowerDetection Unit would be connected into the RESET Tamper Detection Line,thus causing a RESET when triggered. A side effect of the OverUnderPowerDetection Unit is that as the voltage drops during a power-down, a RESETis triggered, thus erasing any work registers.

[2513] No Test Circuitry

[2514] Test hardware on an Authentication Chip could very easilyintroduce vulnerabilities. As a result, the Authentication Chip shouldnot contain any BIST or scan paths. The Authentication Chip musttherefore be testable with external test vectors. This should bepossible since the Authentication Chip is not complex.

[2515] Reading ROM

[2516] This attack depends on the key being stored in an addressableROM. Since each Authentication Chip stores its authentication keys ininternal Flash memory and not in an addressable ROM, this attack isirrelevant.

[2517] Reverse Engineering the Chip

[2518] Reverse engineering a chip is only useful when the security ofauthentication lies in the algorithm alone. However our AuthenticationChips rely on a secret key, and not in the secrecy of the algorithm. Ourauthentication algorithm is, by contrast, public, and in any case, anattacker of a high volume consumable is assumed to have been able toobtain detailed plans of the internals of the chip. In light of thesefactors, reverse engineering the chip itself, as opposed to the storeddata, poses no threat.

[2519] Usurping the Authentication Process

[2520] There are several forms this attack can take, each with varyingdegrees of success. In all cases, it is assumed that a clonemanufacturer will have access to both the System and the consumabledesigns. An attacker may attempt to build a chip that tricks the Systeminto returning a valid code instead of generating an authenticationcode. This attack is not possible for two reasons. The first reason isthat System Authentication chips and Consumable Authentication Chips,although physically identical, are programmed differently. Inparticular, the RD opcode and the RND opcode are the same, as are the WRand TST opcodes. A System authentication Chip cannot perform a RDcommand since every call is interpreted as a call to RND instead. Thesecond reason this attack would fail is that separate serial data linesare provided from the System to the System and Consumable AuthenticationChips. Consequently neither chip can see what is being transmitted to orreceived from the other. If the attacker builds a clone chip thatignores WR commands (which decrement the consumable remaining), Protocol3 ensures that the subsequent RD will detect that the WR did not occur.The System will therefore not go ahead with the use of the consumable,thus thwarting the attacker. The same is true if an attacker simulatesloss of contact before authentication—since the authentication does nottake place, the use of the consumable doesn't occur. An attacker istherefore limited to modifying each System in order for cloneconsumables to be accepted

[2521] Modification of System

[2522] The simplest method of modification is to replace the System'sAuthentication Chip with one that simply reports success for each callto TST. This can be thwarted by System calling TST several times foreach authentication, with the first few times providing false values,and expecting a fail from TST. The final call to TST would be expectedto succeed. The number of false calls to TST could be determined by somepart of the returned result from RD or from the system clock.Unfortunately an attacker could simply rewire System so that the newSystem clone authentication chip 53 can monitor the returned result fromthe consumable chip or clock. The clone System Authentication Chip wouldonly return success when that monitored value is presented to its TSTfunction. Clone consumables could then return any value as the hashresult for RD, as the clone System chip would declare that value valid.There is therefore no point for the System to call the SystemAuthentication Chip multiple times, since a rewiring attack will onlywork for the System that has been rewired, and not for all Systems. Asimilar form of attack on a System is a replacement of the System ROM.The ROM program code can be altered so that the Authentication neveroccurs. There is nothing that can be done about this, since the Systemremains in the hands of a consumer. Of course this would void anywarranty, but the consumer may consider the alteration worthwhile if theclone consumable were extremely cheap and more readily available thanthe original item.

[2523] The System/consumable manufacturer must therefore determine howlikely an attack of this nature is. Such a study must include given thepricing structure of Systems and Consumables, frequency of Systemservice, advantage to the consumer of having a physical modificationperformed, and where consumers would go to get the modificationperformed. The limit case of modifying a system is for a clonemanufacturer to provide a completely clone System which takes cloneconsumables. This may be simple competition or violation of patents.Either way, it is beyond the scope of the Authentication Chip anddepends on the technology or service being cloned.

[2524] Direct Viewing of Chip Operation by Conventional Probing

[2525] In order to view the chip operation, the chip must be operating.However, the Tamper Prevention and Detection circuitry covers thosesections of the chip that process or hold the key. It is not possible toview those sections through the Tamper Prevention lines. An attackercannot simply slice the chip past the Tamper Prevention layer, for thiswill break the Tamper Detection Lines and cause an erasure of all keysat power-up. Simply destroying the erasure circuitry is not sufficient,since the multiple ChipOK bits (now all 0) feeding into multiple unitswithin the Authentication Chip will cause the chip's regular operatingcircuitry to stop functioning. To set up the chip for an attack, then,requires the attacker to delete the Tamper Detection lines, stop theErasure of Flash memory, and somehow rewire the components that reliedon the ChipOK lines. Even if all this could be done, the act of slicingthe chip to this level will most likely destroy the charge patterns inthe non-volatile memory that holds the keys, making the processfruitless.

[2526] Direct Viewing of the Non-Volatile Memory

[2527] If the Authentication Chip were sliced so that the floating gatesof the Flash memory were exposed, without discharging them, then thekeys could probably be viewed directly using an STM or SKM. However,slicing the chip to this level without discharging the gates is probablyimpossible. Using wet etching, plasma etching, ion milling, or chemicalmechanical polishing will almost certainly discharge the small chargespresent on the floating gates. This is true of regular Flash memory, buteven more so of multi-level Flash memory.

[2528] Viewing the Light Bursts Caused by State Changes

[2529] All sections of circuitry that manipulate secret key informationare implemented in the non-Flashing CMOS described above. This preventsthe emission of the majority of light bursts. Regular CMOS invertersplaced in close proximity to the non-Flashing CMOS will hide any faintemissions caused by capacitor charge and discharge. The inverters areconnected to the Tamper Detection circuitry, so they change state manytimes (at the high clock rate) for each non-Flashing CMOS state change.

[2530] Monitoring EMI

[2531] The Noise Generator described above will cause circuit noise. Thenoise will interfere with other electromagnetic emissions from thechip's regular activities and thus obscure any meaningful reading ofinternal data transfers.

[2532] Viewing I_(dd) Fluctuations

[2533] The solution against this kind of attack is to decrease the SNRin the I_(dd) signal. This is accomplished by increasing the amount ofcircuit noise and decreasing the amount of signal. The Noise Generatorcircuit (which also acts as a defense against EMI attacks) will alsocause enough state changes each cycle to obscure any meaningfulinformation in the I_(dd) signal. In addition, the special Non-FlashingCMOS implementation of the key-carrying data paths of the chip preventscurrent from flowing when state changes occur. This has the benefit ofreducing the amount of signal.

[2534] Differential Fault Analysis

[2535] Differential fault bit errors are introduced in a non-targetedfashion by ionization, microwave radiation, and environmental stress.The most likely effect of an attack of this nature is a change in Flashmemory (causing an invalid state) or RAM (bad parity). Invalid statesand bad parity are detected by the Tamper Detection Circuitry, and causean erasure of the key. Since the Tamper Detection Lines cover the keymanipulation circuitry, any error introduced in the key manipulationcircuitry will be mirrored by an error in a Tamper Detection Line. Ifthe Tamper Detection Line is affected, the chip will either continuallyRESET or simply erase the key upon a power-up, rendering the attackfruitless. Rather than relying on a non-targeted attack and hoping that“just the right part of the chip is affected in just the right way”, anattacker is better off trying to introduce a targeted fault (such asoverwrite attacks, gate destruction etc). For information on thesetargeted fault attacks, see the relevant sections below.

[2536] Clock Glitch Attacks

[2537] The Clock Filter (described above) eliminates the possibility ofclock glitch attacks.

[2538] Power Supply Attacks

[2539] The OverUnderPower Detection Unit (described above) eliminatesthe possibility of power supply attacks.

[2540] Overwriting ROM

[2541] Authentication Chips store Program code, keys and secretinformation in Flash memory, and not in ROM. This attack is thereforenot possible.

[2542] Modifying EEPROM/Flash

[2543] Authentication Chips store Program code, keys and secretinformation in Flash memory. However, Flash memory is covered by twoTamper Prevention and Detection Lines. If either of these lines isbroken (in the process of destroying a gate) the attack will be detectedon power-up, and the chip will either RESET (continually) or erase thekeys from Flash memory. However, even if the attacker is able to somehowaccess the bits of Flash and destroy or short out the gate holding aparticular bit, this will force the bit to have no charge or a fullcharge. These are both invalid states for the Authentication Chip'susage of the multi-level Flash memory (only the two middle states arevalid). When that data value is transferred from Flash, detectioncircuitry will cause the Erasure Tamper Detection Line to betriggered—thereby erasing the remainder of Flash memory and RESETing thechip. A Modify EEPROM/Flash Attack is therefore fruitless.

[2544] Gate Destruction Attacks

[2545] Gate Destruction Attacks rely on the ability of an attacker tomodify a single gate to cause the chip to reveal information duringoperation. However any circuitry that manipulates secret information iscovered by one of the two Tamper Prevention and Detection lines. Ifeither of these lines is broken (in the process of destroying a gate)the attack will be detected on power-up, and the chip will either RESET(continually) or erase the keys from Flash memory. To launch this kindof attack, an attacker must first reverse-engineer the chip to determinewhich gate(s) should be targeted. Once the location of the target gateshas been determined, the attacker must break the covering TamperDetection line, stop the Erasure of Flash memory, and somehow rewire thecomponents that rely on the ChipOK lines. Rewiring the circuitry cannotbe done without slicing the chip, and even if it could be done, the actof slicing the chip to this level will most likely destroy the chargepatterns in the non-volatile memory that holds the keys, making theprocess fruitless.

[2546] Overwrite Attacks

[2547] An Overwrite Attack relies on being able to set individual bitsof the key without knowing the previous value. It relies on probing thechip, as in the Conventional Probing Attack and destroying gates as inthe Gate Destruction Attack. Both of these attacks (as explained intheir respective sections), will not succeed due to the use of theTamper Prevention and Detection Circuitry and ChipOK lines. However,even if the attacker is able to somehow access the bits of Flash anddestroy or short out the gate holding a particular bit, this will forcethe bit to have no charge or a full charge. These are both invalidstates for the Authentication Chip's usage of the multi-level Flashmemory (only the two middle states are valid). When that data value istransferred from Flash detection circuitry will cause the Erasure TamperDetection Line to be triggered—thereby erasing the remainder of Flashmemory and RESETing the chip. In the same way, a parity check ontampered values read from RAM will cause the Erasure Tamper DetectionLine to be triggered. An Overwrite Attack is therefore fruitless.

[2548] Memory Remanence Attack

[2549] Any working registers or RAM within the Authentication Chip maybe holding part of the authentication keys when power is removed. Theworking registers and RAM would continue to hold the information forsome time after the removal of power. If the chip were sliced so thatthe gates of the registers/RAM were exposed, without discharging them,then the data could probably be viewed directly using an STM. The firstdefense can be found above, in the description of defense against PowerGlitch Attacks. When power is removed, all registers and RAM arecleared, just as the RESET condition causes a clearing of memory. Thechances then, are less for this attack to succeed than for a reading ofthe Flash memory. RAM charges (by nature) are more easily lost thanFlash memory. The slicing of the chip to reveal the RAM will certainlycause the charges to be lost (if they haven't been lost simply due tothe memory not being refreshed and the time taken to perform theslicing). This attack is therefore fruitless.

[2550] Chip Theft Attack

[2551] There are distinct phases in the lifetime of an AuthenticationChip. Chips can be stolen when at any of these stages:

[2552] After manufacture, but before programming of key

[2553] After programming of key, but before programming of state data

[2554] After programming of state data, but before insertion into theconsumable or system

[2555] After insertion into the system or consumable

[2556] A theft in between the chip manufacturer and programming stationwould only provide the clone manufacturer with blank chips. This merelycompromises the sale of Authentication chips, not anything authenticatedby the Authentication chips. Since the programming station is the onlymechanism with consumable and system product keys, a clone manufacturerwould not be able to program the chips with the correct key. Clonemanufacturers would be able to program the blank chips for their ownSystems and Consumables, but it would be difficult to place these itemson the market without detection. The second form of theft can onlyhappen in a situation where an Authentication Chip passes through two ormore distinct programming phases. This is possible, but unlikely. In anycase, the worst situation is where no state data has been programmed, soall of M is read/write. If this were the case, an attacker could attemptto launch an Adaptive Chosen Text Attack on the chip. The HMAC-SHA1algorithm is resistant to such attacks. The third form of theft wouldhave to take place in between the programming station and theinstallation factory. The Authentication chips would already beprogrammed for use in a particular system or for use in a particularconsumable. The only use these chips have to a thief is to place theminto a clone System or clone Consumable. Clone systems are irrelevant—acloned System would not even require an authentication chip 53. Forclone Consumables, such a theft would limit the number of clonedproducts to the number of chips stolen. A single theft should not createa supply constant enough to provide clone manufacturers with acost-effective business. The final form of theft is where the System orConsumable itself is stolen. When the theft occurs at the manufacturer,physical security protocols must be enhanced. If the theft occursanywhere else, it is a matter of concern only for the owner of the itemand the police or insurance company. The security mechanisms that theAuthentication Chip uses assume that the consumables and systems are inthe hands of the public. Consequently, having them stolen makes nodifference to the security of the keys.

[2557] Authentication Chip Design

[2558] The Authentication Chip has a physical and a logical externalinterface. The physical interface defines how the Authentication Chipcan be connected to a physical System, and the logical interfacedetermines how that System can communicate with the Authentication Chip.

[2559] Physical Interface

[2560] The Authentication Chip is a small 4-pin CMOS package (actualinternal size is approximately 0.30 mm² using 0.25 mm Flash process).The 4 pins are GND, CLK, Power, and Data. Power is a nominal voltage. Ifthe voltage deviates from this by more than a fixed amount, the chipwill RESET. The recommended clock speed is 4-10 MHz. Internal circuitryfilters the clock signal to ensure that a safe maximum clock speed isnot exceeded. Data is transmitted and received one bit at a time alongthe serial data line. The chip performs a RESET upon power-up,power-down. In addition, tamper detection and prevention circuitry inthe chip will cause the chip to either RESET or erase Flash memory(depending on the attack detected) if an attack is detected. A specialProgramming Mode is enabled by holding the CLK voltage at a particularlevel. This is defined further in the next section.

[2561] Logical Interface

[2562] The Authentication Chip has two operating modes—a Normal Mode anda Programming Mode. The two modes are required because the operatingprogram code is stored in Flash memory instead of ROM (for securityreasons). The Programming mode is used for testing purposes aftermanufacture and to load up the operating program code, while the normalmode is used for all subsequent usage of the chip.

[2563] Programming Mode

[2564] The Programming Mode is enabled by holding a specific voltage onthe CLK line for a given amount of time. When the chip entersProgramming Mode, all Flash memory is erased (including all secret keyinformation and any program code). The Authentication Chip thenvalidates the erasure. If the erasure was successful, the AuthenticationChip receives 384 bytes of data corresponding to the new program code.The bytes are transferred in order byte₀ to byte₃₈₃. The bits aretransferred from bit₀ to bit₇. Once all 384 bytes of program code havebeen loaded, the Authentication Chip hangs. If the erasure was notsuccessful, the Authentication Chip will hang without loading any datainto the Flash memory. After the chip has been programmed, it can berestarted. When the chip is RESET with a normal voltage on the CLK line,Normal Mode is entered.

[2565] Normal Mode

[2566] Whenever the Authentication Chip is not in Programming Mode, itis in Normal Mode. When the Authentication Chip starts up in Normal Mode(for example a power-up RESET), it executes the program currently storedin the program code region of Flash memory. The program code implementsa communication mechanism between the System and Authentication Chip,accepting commands and data from the System and producing output values.Since the Authentication Chip communicates serially, bits aretransferred one at a times. The System communicates with theAuthentication Chips via a simple operation command set. Each command isdefined by 3-bit opcode. The interpretation of the opcode depends on thecurrent value of the IsTrusted bit and the IsWritten bit.

[2567] The following operations are defined: Op T W Mn Input OutputDescription 000 — — CLR — — Clear 001 0 0 SSI [160, 160, — Set Secret160] Information 010 0 1 RD [160, 160] [256, Read M securely 160] 010 11 RND — [160, Random 160] 011 0 1 WR [256] — Write M 011 1 1 TST [256,160] [1] Test 100 0 1 SAM [32] [32] Set Access Mode 101 — 1 GIT — [1]Get Is Trusted 110 — 1 SMT [32] — Set MinTicks

[2568] Any command not defined in this table is interpreted as NOP (Nooperation). Examples include opcodes 110 and 111 (regardless ofIsTrusted or IsWritten values, and any opcode other than SSI whenIsWritten=0. Note that the opcode for RD and RND are the same, as arethe opcodes for WR and TST. The actual command run upon receipt of theopcode will depend on the current values of the IsTrusted bit (as longas IsWritten is 1). Where the IsTrusted bit is clear, RD and WRfunctions will be called. Where the IsTrusted bit is set, RND and TSTfunctions will be called. The two sets of commands are mutuallyexclusive between trusted and non-trusted Authentication Chips. In orderto execute a command on an Authentication Chip, a client (such asSystem) sends the command opcode followed by the required inputparameters for that opcode. The opcode is sent least significant bitthrough to most significant bit. For example, to send the SSI command,the bits 1, 0, and 0 would be sent in that order. Each input parameteris sent in the same way, least significant bit first through to mostsignificant bit last. Return values are read in the same way—leastsignificant bit first and most significant bit last. The client mustknow how many bits to retrieve. In some cases, the output bits from onechip's command can be fed directly as the input bits to another chip'scommand. An example of this is the RND and RD commands. The output bitsfrom a call to RND on a trusted Authentication Chip do not have to bekept by System. Instead, System can transfer the output bits directly tothe input of the non-trusted Authentication Chip's RD command. Thedescription of each command points out where this is so. Each of thecommands is examined in detail in the subsequent sections. Note thatsome algorithms are specifically designed because the permanentregisters are kept in Flash memory.

[2569] Registers

[2570] The memory within the Authentication Chip contains somenon-volatile memory to store the variables required by theAuthentication Protocol. The following non-volatile (Flash) variablesare defined: Size (in Variable Name bits) Description M[0 . . . 15] 25616 words (each 16 bits) containing state data such as serial numbers,media remaining etc. K₁ 160 Key used to transform R duringauthentication. K₂ 160 Key used to transform M during authentication. R160 Current random number AccessMode 32 The 16 sets of 2-bit AccessModevalues [0 . . . 15] for M[n]. MinTicks 32 The minimum number of clockticks between calls to key-based functions SIWritten 1 If set, thesecret key information (K₁, K₂, and R) has been written to the chip. Ifclear, the secret information has not been written yet. IsTrusted 1 Ifset, the RND and TST functions can be called, but RD and WR functionscannot be called. If clear, the RND and TST functions cannot be called,but RD and WR functions can be called. Total bits 802

[2571] Architecture Overview

[2572] This section chapter provides the high-level definition of apurpose-built CPU capable of implementing the functionality required ofan Authentication Chip. Note that this CPU is not a general purpose CPU.It is tailor-made for implementing the Authentication logic. Theauthentication commands that a user of an Authentication Chip sees, suchas WRITE, TST, RND etc are all implemented as small programs written inthe CPU instruction set. The CPU contains a 32-bit Accumulator (which isused in most operations), and a number of registers. The CPU operates on8-bit instructions specifically tailored to implementing authenticationlogic. Each 8-bit instruction typically consists of a 4-bit opcode, anda 4-bit operand.

[2573] Operating Speed

[2574] An internal Clock Frequency Limiter Unit prevents the chip fromoperating at speeds any faster than a predetermined frequency. Thefrequency is built into the chip during manufacture, and cannot bechanged. The frequency is recommended to be about 4-10 MHz.

[2575] Composition and Block Diagram

[2576] The Authentication Chip contains the following components: CMOSUnit Name Type Description Clock Frequency Normal Ensures the operatingfrequency of Limiter the Authentication Chip does not exceed a specificmaximum frequency. OverUnderPower Normal Ensures that the power supplyDetection Unit remains in a valid operating range. Programming NormalAllows users to enter Programming Mode Mode. Detection Unit NoiseGenerator Normal For generating I_(dd) noise and for use in the TamperPrevention and Detection circuitry. State Machine Normal for controllingthe two operating modes of the chip (Programming Mode and Normal Mode).This includes generating the two operating cycles of the CPU, stallingduring long command operations, and storing the op-code and operandduring operating cycles. I/O Unit Normal Responsible for communicatingserially with the outside world. ALU Non- Contains the 32-bitaccumulator as flashing well as the general mathematical and logicaloperators. MinTicks Unit Normal Responsible for a programmable (99%),minimum delay (via a countdown) Non- between certain key-based flashingoperations. (1%) Address Normal Generates direct, indirect, andGenerator Unit (99%), indexed addresses as required by Non- specificoperands. flashing (1%) Program Counter Normal Includes the 9 bit PC(program Unit counter), as well as logic for branching and subroutinecontrol Memory Unit Non- Addressed by 9 bits of address. It flashingcontains an 8-bit wide program Flash memory, and 32-bit wide Flashmemory, RAM, and look-up tables. Also contains Programming Modecircuitry to enable loading of program code.

[2577]FIG. 181 illustrates a schematic block diagram of theAuthentication Chip. The tamper prevention and Detection Circuitry isnot shown: The Noise Generator, OverUnderPower Detection Unit, andProgrammingMode Detection Unit are connected to the Tamper Preventionand Detection Circuitry and not to the remaining units.

[2578] Memory Map

[2579]FIG. 182 illustrates an example memory map. Although theAuthentication Chip does not have external memory, it does have internalmemory. The internal memory is addressed by 9 bits, and is either32-bits wide or 8-bits wide (depending on address). The 32-bit widememory is used to hold the nonvolatile data, the variables used forHMAC-SHA1, and constants. The 8-bit wide memory is used to hold theprogram and the various jump tables used by the program. The addressbreakup (including reserved memory ranges) is designed to optimizeaddress generation and decoding.

[2580] Constants

[2581]FIG. 183 illustrates an example of the constants memory map. TheConstants region consists of 32-bit constants. These are the simpleconstants (such as 32-bits of all 0 and 32-bits of all 1), the constantsused by the HMAC algorithm, and the constants y₀₋₃ and h₀₋₄ required foruse in the SHA-1 algorithm. None of these values are affected by aRESET. The only opcode that makes use of constants is LDK. In this case,the operands and the memory placement are closely linked, in order tominimize the address generation and decoding.

[2582] RAM

[2583]FIG. 184 illustrates an example of the RAM memory map. The RAMregion consists of the 32 parity-checked 32-bit registers required forthe general functioning of the Authentication Chip, but only during theoperation of the chip. RAM is volatile memory, which means that oncepower is removed, the values are lost. Note that in actual fact, memoryretains its value for some period of time after power-down (due tomemory remnance), but cannot be considered to be available uponpower-up. This has issues for security that are addressed in othersections of this document. RAM contains the variables used for theHMAC-SHA1 algorithm, namely: A-E, the temporary variable T, space forthe 160-bit working hash value H, space for temporary storage of a hashresult (required by HMAC) B160, and the space for the 512 bits ofexpanded hashing memory X. All RAM values are cleared to 0 upon a RESET,although any program code should not take this for granted. Opcodes thatmake use of RAM addresses are LD, ST, ADD, LOG, XOR, and RPL. In allcases, the operands and the memory placement are closely linked, inorder to minimize the address generation and decoding (multiwordvariables are stored most significant word first).

[2584] Flash Memory—Variables

[2585]FIG. 185 illustrates an example of the Flash memory variablesmemory map. The Flash memory region contains the non-volatileinformation in the Authentication Chip. Flash memory retains its valueafter power is removed, and can be expected to be unchanged when thepower is next turned on. The non-volatile information kept inmulti-state Flash memory includes the two 160-bit keys (K₁ and K₂), thecurrent random number value (R), the state data (M), the MinTicks value(MT), the AccessMode value (AM), and the IsWritten (ISW) and IsTrusted(IST) flags. Flash values are unchanged by a RESET, but are cleared (to0) upon entering Programming Mode. Operations that make use of Flashaddresses are LD, ST, ADD, RPL, ROR, CLR, and SET. In all cases, theoperands and the memory placement are closely linked, in order tominimize the address generation and decoding. Multiword variables K₁,K₂, and M are stored most significant word first due to addressingrequirements. The addressing scheme used is a base address offset by anindex that starts at N and ends at 0. Thus M_(N) is the first wordaccessed, and M₀ is the last 32-bit word accessed in loop processing.Multiword variable R is stored least significant word first for ease ofLFSR generation using the same indexing scheme.

[2586] Flash Memory—Program

[2587]FIG. 186 illustrates an example of the Flash memory program memorymap. The second multi-state Flash memory region is 384×8-bits. Theregion contains the address tables for the JSR, JSI and TBRinstructions, the offsets for the DBR commands, constants and theprogram itself. The Flash memory is unaffected by a RESET, but iscleared (to 0) upon entering Programming Mode. Once Programming Mode hasbeen entered, the 8-bit Flash memory can be loaded with a new set of 384bytes. Once this has been done, the chip can be RESET and the normalchip operations can occur.

[2588] Registers

[2589] A number of registers are defined in the Authentication Chip.They are used for temporary storage during function execution. Some areused for arithmetic functions, others are used for counting andindexing, and others are used for serial I/O. These registers do notneed to be kept in non-volatile (Flash) memory. They can be read orwritten without the need for an erase cycle (unlike Flash memory).Temporary storage registers that contain secret information still needto be protected from physical attack by Tamper Prevention and Detectioncircuitry and parity checks.

[2590] All registers are cleared to 0 on a RESET. However, program codeshould not assume any particular state, and set up register valuesappropriately. Note that these registers do not include the various OKbits defined for the Tamper Prevention and Detection circuitry. The OKbits are scattered throughout the various units and are set to 1 upon aRESET.

[2591] Cycle

[2592] The 1-bit Cycle value determines whether the CPU is in a Fetchcycle (0) or an Execute cycle (1). Cycle is actually derived from a1-bit register that holds the previous Cycle value. Cycle is notdirectly accessible from the instruction set. It is an internal registeronly.

[2593] Program Counter

[2594] A 6-level deep 9-bit Program Counter Array (PCA) is defined. Itis indexed by a 3-bit Stack Pointer (SP). The current Program Counter(PC), containing the address of the currently executing instruction, iseffectively PCA[SP]. In addition, a 9-bit Adr register is defined,containing the resolved address of the current memory reference (forindexed or indirect memory accesses). The PCA, SP, and Adr registers arenot directly accessible from the instruction set. They are internalregisters only

[2595] CMD

[2596] The 8-bit CMD register is used to hold the currently executingcommand. While the CMD register is not directly accessible from theinstruction set, and is an internal register only.

[2597] Accumulator and Z Flag

[2598] The Accumulator is a 32-bit general-purpose register. It is usedas one of the inputs to all arithmetic operations, and is the registerused for transferring information between memory registers. The Zregister is a 1-bit flag, and is updated each time the Accumulator iswritten to. The Z register contains the zero-ness of the Accumulator.Z=1 if the last value written to the Accumulator was 0, and 0 if thelast value written was non-0. Both the Accumulator and Z registers aredirectly accessible from the instruction set.

[2599] Counters

[2600] A number of special purpose counters/index registers are defined:Register Name Size Bits Description C1 1 x 3 3 Counter used to indexarrays: AE, B160, M, H, y, and h. C2 1 x 5 5 General purpose counterN₁₋₄ 4 x 4 16 Used to index array X

[2601] All these counter registers are directly accessible from theinstruction set. Special instructions exist to load them with specificvalues, and other instructions exist to decrement or increment them, orto branch depending on the whether or not the specific counter is zero.There are also 2 special flags (not registers) associated with C1 andC2, and these flags hold the zero-ness of C1 or C2. The flags are usedfor loop control, and are listed here, for although they are notregisters, they can be tested like registers. Name Description C1Z 1 =C1 is current zero, 0 = C1 is currently non-zero. C2Z 1 = C2 is currentzero, 0 = C2 is currently non-zero.

[2602] Flags

[2603] A number of 1-bit flags, corresponding to CPU operating modes,are defined: Name Bits Description WE 1 WriteEnable for X registerarray: 0 = Writes to X registers become no-ops 1 = Writes to X registersare carried out K2MX 1 0 = K1 is accessed during K references. Readsfrom M are interpreted as reads of 0 1 = K2 is accessed during Kreferences. Reads from M succeed.

[2604] All these 1-bit flags are directly accessible from theinstruction set. Special instructions exist to set and clear theseflags. Registers used for Write Integrity Name Bits Description EE 1Corresponds to the EqEncountered variable in the WR command pseudocode.Used during the writing of multi- precision data values to determinewhether all more significant components have been equal to theirprevious values. DE 1 Corresponds to the DecEncountered variable in theWR command pseudocode. Used during the writing of multi- precision datavalues to determine whether a more significant components has beendecremented already.

[2605] Registers Used for I/O

[2606] Four 1-bit registers are defined for communication between theclient (System) and the Authentication Chip. These registers are InBit,InBitValid, OutBit, and OutBitValid. InBit and InBitValid provide themeans for clients to pass commands and data to the Authentication Chip.OutBit and OutBitValid provide the means for clients to get informationfrom the Authentication Chip. A client sends commands and parameter bitsto the Authentication Chip one bit at a time. Since the AuthenticationChip is a slave device, from the Authentication Chip's point of view:

[2607] Reads from InBit will hang while InBitValid is clear. InBitValidwill remain clear until the client has written the next input bit toInBit. Reading InBit clears the InBitValid bit to allow the next InBitto be read from the client. A client cannot write a bit to theAuthentication Chip unless the InBitValid bit is clear.

[2608] Writes to OutBit will hang while OutBitValid is set. OutBitValidwill remain set until the client has read the bit from OutBit. WritingOutBit sets the OutBitValid bit to allow the next OutBit to be read bythe client. A client cannot read a bit from the Authentication Chipunless the OutBitValid bit is set.

[2609] Registers Used for Timing Access

[2610] A single 32-bit register is defined for use as a timer. The MTR(MinTicksRemaining) register decrements every time an instruction isexecuted. Once the MTR register gets to 0, it stays at zero. Associatedwith MTR is a 1-bit flag MTRZ, which contains the zero-ness of the MTRregister. If MTRZ is 1, then the MTR register is zero. If MTRZ is 0,then the MTR register is not zero yet. MTR always starts off at theMinTicks value (after a RESET or a specific key-accessing function), andeventually decrements to 0. While MTR can be set and MTRZ tested byspecific instructions, the value of MTR cannot be directly read by anyinstruction.

[2611] Register Summary

[2612] The following table summarizes all temporary registers (orderedby register name). It lists register names, size (in bits), as well aswhere the specified register can be found. Register Name Bits ParityWhere Found Acc 32 1 Arithmetic Logic Unit Adr 9 1 Address GeneratorUnit ANT 32 Arithmetic Logic Unit C1 3 1 Address Generator Unit C2 5 1Address Generator Unit CMD 8 1 State Machine Cycle (Old = 1 StateMachine prev Cycle) DE 1 Arithmetic Logic Unit EE 1 Arithmetic LogicUnit InBit 1 Input Output Unit InBitValid 1 Input Output Unit K2MX 1Address Generator Unit MTR 32 1 MinTicks Unit MTRZ 1 MinTicks UnitN[1-4] 16 4 Address Generator Unit OutBit 1 Input Output UnitOutBitValid 1 Input Output Unit PCA 54 6 Program Counter Unit RTMP 1Arithmetic Logic Unit SP 3 1 Program Counter Unit WE 1 Memory Unit Z 1Arithmetic Logic Unit Total bits 206 17

[2613] Instruction Set

[2614] The CPU operates on 8-bit instructions specifically tailored toimplementing authentication logic. The majority of 8-bit instructionconsists of a 4-bit opcode, and a 4-bit operand. The high-order 4 bitscontains the opcode, and the low-order 4 bits contains the operand.

[2615] Opcodes and Operands (Summary)

[2616] The opcodes are summarized in the following table: OpcodeMnemonic Simple Description 0000 TBR Test and branch. 0001 DBR Decrementand branch 001 JSR Jump subroutine via table 01000 RTS Return fromsubroutine 01001 JSI Jump subroutine indirect 0101 SC Set counter 0110CLR Clear specific flash registers 0111 SET Set bits in specific flashregister 1000 ADD Add a 32 bit value to the Accumulator 1001 LOG Logicaloperation (AND, and OR 1010 XOR Exclusive-OR Accumulator with some value1011 LD Load Accumulator from specified location 1100 ROR RotateAccumulator right 1101 RPL Replace bits 1110 LOK Load Accumulator with aconstant 1111 ST Store Accumulator in specified location

[2617] The following table is a summary of which operands can be usedwith which opcodes. The table is ordered alphabetically by opcodemnemonic. The binary values for each operand can be found in thesubsequent tables. Opcode Valid Operand ADD {A, B, C, D, E, T, MT, AM,AE [C1], B160 [C1], H [C1], M [C1], K [C1], R [C1], X [N4]} CLR {WE,K2MX, M [C1], Group1, Group2} DBR {C1, C2}, Offset into DBR Table JSI {} JSR Offset into Table 1 LD {A, B, C, D, E, T, MT, AM, AE [C1], B160[C1], H [C1], M [C1], K [C1], R [C1], X [N4]} LDK {0 × 0000 . . . , 0 ×3636 . . . , 0 × 5C5C . . . , 0 × FFFF, h [C1], y [C1]} LOG {AND, OR},{A, B, C, D, F, T, MT, AM} ROR {InBit, OutBit, LFSR, RLFSR, IST, ISW,MTRZ, 1, 2, 27, 31} RPL {Init, MHI, MLO} RTS { } SC {C1, C2}, Offsetinto counter list SET {WE, K2MX, Nx, MTR, IST, ISW} ST {A, B, C, D, E,T, MT, AM, AE [C1], B160 [C1], H [C1], M [C1], K [C1], R [C1], X [N4]}TBR {0, 1}, Offset into Table 1 XOR {A, B, C, D, E, T, MT, AM, X [N1], X[N2], X [N3], X [N4]}

[2618] The following operand table shows the interpretation of the 4-bitoperands where all 4 bits are used for direct interpretation. ADD,Operand LD, ST XOR ROR LDK RPL SET CLR 0000 E E InBit 0x00 . . . Init WEWE 0001 D D OutBit 0x36 . . . — K2MX K2MX 0010 C C RB 0x5C . . . — Nx —0011 B B XRB 0xFF . . . — — — 0100 A A IST y[C1] — IST — 0101 T T ISW —— ISW — 0110 MT MT MTRZ — — MTR — 0111 AM AM  1 — — — — 1000 AE[C1] — —h[C1] — — — 1001 B160[C1] —  2 — — — — 1010 H[C1] — 27 — — — — 1011 — —— — — — — 1100 R[C1] X[N1] 31 — — — R 1101 K[C1] X[N2] — — — — Group11110 M[C1] X[N3] — — MLO — M[C1] 1111 X[N4] X[N4] — — MHI — Group2

[2619] The following instructions make a selection based upon thehighest bit of the operand: Which Which Counter? operation? Which Value?Operand₃ (DBR, SC) (LOG) (TBR) 0 C1 AND Zero 1 C2 OR Non-zero

[2620] The lowest 3 bits of the operand are either offsets (DBR, TBR),values from a special table (SC) or as in the case of LOG, they selectthe second input for the logical operation. The interpretation matchesthe interpretation for the ADD, LD, and ST opcodes: Operand₂₋₀ LOGInput2 SC Value 000 E 2 001 D 3 010 C 4 011 B 7 100 A 10 101 T 15 110 MT19 111 AM 31

[2621] ADD - Add To Accumulator Mnemonic: ADD Opcode: 1000 Usage: ADDValue

[2622] The ADD instruction adds the specified operand to the Accumulatorvia modulo 2³² addition. The operand is one of A, B, C, D, E, T, AM, MT,AE[C1], H[C1], B160[C1], R[C1], K[C1], M[C1], or X[N4]. The Z flag isalso set during this operation, depending on whether the value loaded iszero or not. CLR - Clear Bits Mnemonic: CLR Opcode: 0110 Usage: CLRFlag/Register

[2623] The CLR instruction causes the specified internal flag or Flashmemory registers to be cleared. In the case of Flash memory, althoughthe CLR instruction takes some time the next instruction is stalleduntil the erasure of Flash memory has finished. The registers that canbe cleared are WE and K₂MX. The Flash memory that can be cleared are: R,M[C1], Group1, and Group2. Group1 is the IST and ISW flags. If these arecleared, then the only valid high level command is the SSI instruction.Group2 is the MT, AM, K₁ and K₂ registers. R is erased separately sinceit must be updated after each call to TST. M is also erased via an indexmechanism to allow individual parts of M to be updated. There is also acorresponding SET instruction. DBR - Decrement and Branch Mnemonic: DBROpoode: 0001 Usage: DBR Counter, Offset

[2624] This instruction provides the mechanism for building simpleloops. The high hit of the operand selects between testing C1or C2 (thetwo counters). If the specified counter is non-zero, then the counter isdecremented and the value at the given offset (sign extended) is addedto the PC. If the specified counter is zero, it is decremented andprocessing continues at PC+1. The 8-entry offset table is stored ataddress 0 1100 0000 (the 64^(th) entry of the program memory). The 8bits of offset are treated as a signed number. Thus OxFF is treated as−1, and 0x01 is treated as +1. Typically the value will be negative foruse in loops. JSI - Jump Subroutine Indirect Mnemonic: JSI Opcode: 01001Usage: JSI (Acc)

[2625] The JSI instruction allows the jumping to a subroutine dependanton the value currently in the Accumulator. The instruction pushes thecurrent PC onto the stack, and loads the PC with a new value. The upper8 bits of the new PC are loaded from Jump Table 2 (offset given by thelower 5 bits of the Accumulator), and the lowest bit of the PC iscleared to 0. Thus all subroutines must start at even addresses. Thestack provides for 6 levels of execution (5 subroutines deep). It is theresponsibility of the programmer to ensure that this depth is notexceeded or the return value will be overwritten (since the stackwraps). JSR - Jump Subroutine Mnemonic: JSR Opcode: 001 Usage: JSROffset

[2626] The JSR instruction provides for the most common usage of thesubroutine construct. The instruction pushes the current PC onto thestack, and loads the PC with a new value. The upper 8 bits of the new PCvalue comes from Address Table 1, with the offset into the tableprovided by the 5-bit operand (32 possible addresses). The lowest bit ofthe new PC is cleared to 0. Thus all subroutines must start at evenaddresses. The stack provides for 6 levels of execution (5 subroutinesdeep). It is the responsibility of the programmer to ensure that thisdepth is not exceeded or the return value will be overwritten (since thestack wraps). LD - Load Accumulator Mnemonic: LD Opcode: 1011 Usage: LDValue

[2627] The LD instruction loads the Accumulator from the specifiedoperand. The operand is one of A, B, C, D, E, T, AM, MT, AE[C1], H[C1],B160[C1], R[C1], K[C1], M[C1], or X[N4]. The Z flag is also set duringthis operation, depending on whether the value loaded is zero or not.LDK - Load Constant Mnemonic: LDK Opcode: 1110 Usage: LDK Constant

[2628] The LDK instruction loads the Accumulator with the specifiedconstant. The constants are those 32-bit values required for HMAC-SHA1and all 0s and all 1s as most useful for general purpose processing.Consequently they are a choice of:

[2629] 0x00000000

[2630] 0x36363636

[2631] 0x5C5C5C5C

[2632] 0xFFFFFFFF

[2633] or from the h and y constant tables, indexed by C1. The h and yconstant tables hold the 32-bit tabular constants required forHMAC-SHA1. The Z flag is also set during this operation, depending onwhether the constant loaded is zero or not. LOG - Logical OperationMnemonic: LOG Opcode: 1001 Usage: LOG Operation Value

[2634] The LOG instruction performs 32-bit bitwise logical operations onthe Accumulator and a specified value. The two operations supported bythe LOG instruction are AND and OR. Bitwise NOT and XOR operations aresupported by the XOR instruction. The 32-bit value to be ANDed or ORedwith the accumulator is one of the following: A, B, C, D, E, T, MT andAM. The Z flag is also set during this operation, depending on whetherresultant 32-bit value (loaded into the Accumulator) is zero or not.ROR - Rotate Right Mnemonic: ROR Opcode: 1100 Usage: ROR Value

[2635] The ROR instruction provides a way of rotating the Accumulatorright a set number of bits. The bit coming in at the top of theAccumulator (to become bit 31 ) can either come from the previous bit 0of the Accumulator, or from an external 1-bit flag (such as a flag, orthe serial input connection). The bit rotated out can also be outputfrom the serial connection, or combined with an external flag. Theallowed operands are: InBit, OutBit, LFSR, RLFSR, IST, ISW, MTRZ, 1, 2,27, and 31. The Z flag is also set during this operation, depending onwhether resultant 32-bit value (loaded into the Accumulator) is zero ornot. In its simplest form, the operand for the ROR instruction is one of1, 2, 27, 31, indicating how many bit positions the Accumulator shouldbe rotated. For these operands, there is no external input or output—thebits of the Accumulator are merely rotated right. With operands IST,ISW, and MTRZ, the appropriate flag is transferred to the highest bit ofthe Accumulator. The remainder of the Accumulator is shifted right onebit position (bit31 becomes bit 30 etc), with lowest bit of theAccumulator shifted out. With operand InBit, the next serial input bitis transferred to the highest bit of the Accumulator. The InBitValid bitis then cleared. If there is no input bit available from the client yet,execution is suspended until there is one. The remainder of theAccumulator is shifted right one bit position (bit31 becomes bit 30etc), with lowest bit of the Accumulator shifted out.

[2636] With operand OutBit, the Accumulator is shifted right one bitposition. The bit shifted out from bit 0 is stored in the OutBit flagand the OutBitValid flag is set. It is therefore ready for a client toread. If the OutBitValid flag is already set, execution of theinstruction stalls until the OutBit bit has been read by the client (andthe OutBitValid flag cleared). The new bit shifted in to bit 31 shouldbe considered garbage (actually the value currently in the InBitregister). Finally, the RB and XRB operands allow the implementation ofLFSRs and multiple precision shift registers. With RB, the bit shiftedout (formally bit 0) is written to the RTMP register. The registercurrently in the RTMP register becomes the new bit 31 of theAccumulator. Performing multiple ROR RB commands over several 32-bitvalues implements a multiple precision rotate/shift right. The XRBoperates in the same way as RB, in that the current value in the RTMPregister becomes the new bit 31 of the Accumulator. However with the XRBinstruction, the bit formally known as bit 0 does not simply replaceRTMP (as in the RB instruction). Instead, it is XORed with RTMP, and theresult stored in RTMP. This allows the implementation of long LFSRs, asrequired by the Authentication protocol. RPL - Replace Bits Mnemonic:RPL Opcode: 1101 Usage: ROR Value

[2637] The RPL instruction is designed for implementing the high levelWRITE command in the Authentication Chip. The instruction is designed toreplace the upper 16 bits of the Accumulator by the value that willeventually be written to the M array (dependant on the Access Modevalue). The instruction takes 3 operands: Init, MHI, and MLO. The Initoperand sets all internal flags and prepares the RPL unit within the ALUfor subsequent processing. The Accumulator is transferred to an internalAccessMode register. The Accumulator should have been loaded from the AMFlash memory location before the call to RPL Init in the case ofimplementing the WRITE command, or with 0 in the case of implementingthe TST command. The Accumulator is left unchanged. The MHI and MLOoperands refer to whether the upper or lower 16 bits of M[C1] will beused in the comparison against the (always) upper 16 bits of theAccumulator. Each MHI and MLO instruction executed uses the subsequent 2bits from the initialized AccessMode value. The first execution of MHIor MLO uses the lowest 2 bits, the next uses the second two bits etc.

[2638] RTS—Return from Subroutine RTS - Return From Subroutine Mnemonic:RTS Opcode: 01000 Usage: RTS

[2639] The RTS instruction causes execution to resume at the instructionafter the most recently executed JSR or JSI instruction. Hence the term:returning from the subroutine. In actuality, the instruction pulls thesaved PC from the stack, adds 1, and resumes execution at the resultantaddress. Although 6 levels of execution are provided for (5subroutines), it is the responsibility of the programmer to balance eachJSR and JSI instruction with an RTS. An RTS executed with no previousJSR will cause execution to begin at whatever address happens to bepulled from the stack. SC - Set Counter Mnemonic: SC Opcode: 0101 Usage:SC Counter Value

[2640] The SC instruction is used to load a counter with a particularvalue. The operand determines which of counters C1 and C2 is to beloaded. The Value to be loaded is one of 2, 3, 4, 7, 10, 15, 19, and 31.The counter values are used for looping and indexing. Both C1 and C2 canbe used for looping constructs (when combined with the DBR instruction),while only C1 can be used for indexing 32-bit parts of multi-precisionvariables. SET - Set Bits Mnemonic: SET Opcode: 0111 Usage: SETFlag/Register

[2641] The SET instruction allows the setting of particular flags orflash memory. There is also a corresponding CLR instruction. The WE andK2MX operands each set the specified flag for later processing. The ISTand ISW operands each set the appropriate bit in Flash memory, while theMTR operand transfers the current value in the Accumulator into the MTRregister. The SET Nx command loads N1-N4 with the following constants:Constant Initial X[N] Index Loaded referred to N1 2 X[13] N2 7 X[8] N313 X[2] N4 15 X[0]

[2642] ST — Store Accumulator Mnemonic: ST Opcode: 1111 Usage: STLocation

[2643] The ST instruction is stores the current value of the Accumulatorin the specified location. The location is one of A, B, C, D, E, T, AM,MT, AE[C1], H[C1], B160[C1], R[C1], K[C1], M[C1], or X[N4]. The X[N4]operand has the side effect of advancing the N4 index. After the storehas taken place, N4 will be pointing to the next element in the X array.N4 decrements by 1, but since the X array is ordered from high to low,to decrement the index advances to the next element in the array. If thedestination is in Flash memory, the effect of the ST instruction is toset the bits in the Flash memory corresponding to the bits in theAccumulator. To ensure a store of the exact value from the Accumulator,be sure to use the CLR instruction to erase the appropriate memorylocation first. TBR — Test and Branch Mnemonic: TBR Opcode: 0000 Usage:TBR Value Index

[2644] The Test and Branch instruction tests whether the Accumulator iszero or non-zero, and then branches to the given address if theAccumulator's current state matches that being tested for. If the Z flagmatches the TRB test, replace the PC by 9 bit value where bit0=0 andupper 8 bits come from MU. Otherwise increment current PC by 1. TheValue operand is either 0 or 1. A 0 indicates the test is for theAccumulator to be zero. A 1 indicates the test is for the Accumulator tobe non-zero. The Index operand indicates where execution is to jump toshould the test succeed. The remaining 3 bits of operand index into thelowest 8 entries of Jump Table 1. The upper 8 bits are taken from thetable, and the lowest bit (bit 0) is cleared to 0. CMD is cleared to 0upon a RESET. 0 is translated as TBR 0, which means branch to theaddress stored in address offset 0 if the Accumulator=0. Since theAccumulator and Z flag are also cleared to 0 on a RESET, the test willbe true, so the net effect is a jump to the address stored in the 0thentry in the jump table. XOR — Exclusive OR Mnemonic: XOR Opcode: 1010Usage: XOR Value

[2645] The XOR instruction performs a 32-bit bitwise XOR with theAccumulator, and stores the result in the Accumulator. The operand isone of A, B, C, D, E, T, AM, MT, X[N1], X[N2], X[N3], or X[N4]. The Zflag is also set during this operation, depending on the result (i.e.what value is loaded into the Accumulator). A bitwise NOT operation canbe performed by XORing the Accumulator with 0xFFFFFFFF (via the LDKinstruction). The X[N] operands have a side effect of advancing theappropriate index to the next value (after the operation). After the XORhas taken place, the index will be pointing to the next element in the Xarray. N4 is also advanced by the ST X[N4] instruction. The indexdecrements by 1, but since the X array is ordered from high to low, todecrement the index advances to the next element in the array.

[2646] ProgrammingMode Detection Unit

[2647] The ProgrammingMode Detection Unit monitors the input clockvoltage. If the clock voltage is a particular value the Erase TamperDetection Line is triggered to erase all keys, program code, secretinformation etc and enter Program Mode. The ProgrammingMode DetectionUnit can be implemented with regular CMOS, since the key does not passthrough this unit. It does not have to be implemented with non-flashingCMOS. There is no particular need to cover the ProgrammingMode DetectionUnit by the Tamper Detection Lines, since an attacker can always placethe chip in ProgrammingMode via the CLK input. The use of the EraseTamper Detection Line as the signal for entering Programming Mode meansthat if an attacker wants to use Programming Mode as part of an attack,the Erase Tamper Detection Lines must be active and functional. Thismakes an attack on the Authentication Chip far more difficult.

[2648] Noise Generator

[2649] The Noise Generator can be implemented with regular CMOS, sincethe key does not pass through this unit. It does not have to beimplemented with non-flashing CMOS. However, the Noise Generator must beprotected by both Tamper Detection and Prevention lines so that if anattacker attempts to tamper with the unit, the chip will either RESET orerase all secret information. In addition, the bits in the LFSR must bevalidated to ensure they have not been tampered with (i.e. a paritycheck). If the parity check fails, the Erase Tamper Detection Line istriggered. Finally, all 64 bits of the Noise Generator are ORed into asingle bit. If this bit is 0, the Erase Tamper Detection Line istriggered. This is because 0 is an invalid state for an LFSR. There isno point in using an OK bit setup since the Noise Generator bits areonly used by the Tamper Detection and Prevention circuitry.

[2650] State Machine

[2651] The State Machine is responsible for generating the two operatingcycles of the CPU, stalling during long command operations, and storingthe op-code and operand during operating cycles. The State Machine canbe implemented with regular CMOS, since the key does not pass throughthis unit. It does not have to be implemented with non-flashing CMOS.However, the opcode/operand latch needs to be parity-checked. The logicand registers contained in the State Machine must be covered by bothTamper Detection Lines. This is to ensure that the instructions to beexecuted are not changed by an attacker.

[2652] The Authentication Chip does not require the high speeds andthroughput of a general purpose CPU. It must operate fast enough toperform the authentication protocols, but not faster. Rather than havespecialized circuitry for optimizing branch control or executing opcodeswhile fetching the next one (and all the complexity associated withthat), the state machine adopts a simplistic view of the world. Thishelps to minimize design time as well as reducing the possibility oferror in implementation.

[2653] The general operation of the state machine is to generate sets ofcycles:

[2654] Cycle 0: Fetch cycle. This is where the opcode is fetched fromthe program memory, and the effective address from the fetched opcode isgenerated.

[2655] Cycle 1: Execute cycle. This is where the operand is(potentially) looked up via the generated effective address (from Cycle0) and the operation itself is executed.

[2656] Under normal conditions, the state machine generates cycles: 0,1, 0, 1, 0, 1, 0, 1 . . . However, in some cases, the state machinestalls, generating Cycle 0 each clock tick until the stall conditionfinishes. Stall conditions include waiting for erase cycles of Flashmemory, waiting for clients to read or write serial information, or aninvalid opcode (due to tampering). If the Flash memory is currentlybeing erased, the next instruction cannot execute until the Flash memoryhas finished being erased. This is determined by the Wait signal comingfrom the Memory Unit. If Wait=1, the State Machine must only generateCycle 0s. There are also two cases for stalling due to serial I/Ooperations:

[2657] The opcode is ROR OutBit, and OutBitValid already=1. This meansthat the current operation requires outputting a bit to the client, butthe client hasn't read the last bit yet.

[2658] The operation is ROR InBit, and InBitValid=0. This means that thecurrent operation requires reading a bit from the client, but the clienthasn't supplied the bit yet.

[2659] In both these cases, the state machine must stall until thestalling condition has finished. The next “cycle” therefore depends onthe old or previous cycle, and the current values of CMD, Wait,OutBitValid, and InBitValid. Wait comes from the MU, and OutBitValid andInBitValid come from the I/O Unit. When Cycle is 0, the 8-bit op-code isfetched from the memory unit and placed in the 8-bit CMD register. Thewrite enable for the CMD register is therefore ˜Cycle. There are twooutputs from this unit: Cycle and CMD. Both of these values are passedinto all the other processing units within the Authentication Chip. The1-bit Cycle value lets each unit know whether a fetch or execute cycleis taking place, while the 8-bit CMD value allows each unit to takeappropriate action for commands related to the specific unit.

[2660]FIG. 187 shows the data flow and relationship between componentsof the State Machine where: Logic₁: Wait OR ˜(Old OR ((CMD=ROR) &((CMD=InBit AND ˜InBitValid) OR (CMD=OutBit AND OutBitValid))))

[2661] Old and CMD are both cleared to 0 upon a RESET. This results inthe first cycle being 1, which causes the 0 CMD to be executed. 0 istranslated as TBR 0, which means branch to the address stored in addressoffset 0 if the Accumulator=0. Since the Accumulator is also cleared to0 on a RESET, the test will be true, so the net effect is a jump to theaddress stored in the 0th entry in the jump table. The two VAL units aredesigned to validate the data that passes through them. Each contains anOK bit connected to both Tamper Prevention and Detection Lines. The OKbit is set to 1 on RESET, and ORed with the ChipOK values from bothTamper Detection Lines each cycle. The OK bit is ANDed with each databit that passes through the unit. In the case of VAL₁, the effectiveCycle will always be 0 if the chip has been tampered with. Thus noprogram code will execute since there will never be a Cycle 1. There isno need to check if Old has been tampered with, for if an attackerfreezes the Old state, the chip will not execute any furtherinstructions. In the case of VAL₂, the effective 8-bit CMD value willalways be 0 if the chip has been tampered with, which is the TBR 0instruction. This will stop execution of any program code. VAL₂ alsoperforms a parity check on the bits from CMD to ensure that CMD has notbeen tampered with. If the parity check fails, the Erase TamperDetection Line is triggered.

[2662] I/O Unit

[2663] The I/O Unit is responsible for communicating serially with theoutside world. The Authentication Chip acts as a slave serial device,accepting serial data from a client, processing the command, and sendingthe resultant data to the client serially. The I/O Unit can beimplemented with regular CMOS, since the key does not pass through thisunit. It does not have to be implemented with non-flashing CMOS. Inaddition, none of the latches need to be parity checked since there isno advantage for an attacker to destroy or modify them. The I/O Unitoutputs 0s and inputs 0s if either of the Tamper Detection Lines isbroken. This will only come into effect if an attacker has disabled theRESET and/or erase circuitry, since breaking either Tamper DetectionLines should result in a RESET or the erasure of all Flash memory

[2664] The InBit, InBitValid, OutBit, and OutBitValid 1 bit registersare used for communication between the client (System) and theAuthentication Chip. InBit and InBitValid provide the means for clientsto pass commands and data to the Authentication Chip. OutBit andOutBitValid provide the means for clients to get information from theAuthentication Chip. When the chip is RESET, InBitValid and OutBitValidare both cleared. A client sends commands and parameter bits to theAuthentication Chip one bit at a time. From the Authentication Chip'spoint of view:

[2665] Reads from InBit will hang while InBitValid is clear. InBitValidwill remain clear until the client has written the next input bit toInBit. Reading InBit clears the InBitValid bit to allow the next InBitto be read from the client. A client cannot write a bit to theAuthentication Chip unless the InBitValid bit is clear.

[2666] Writes to OutBit will hang while OutBitValid is set. OutBitValidwill remain set until the client has read the bit from OutBit. WritingOutBit sets the OutBitValid bit to allow the next OutBit to be read bythe client. A client cannot read a bit from the Authentication Chipunless the OutBitValid bit is set.

[2667] The actual stalling of commands is taken care of by the StateMachine, but the various communication registers and the communicationcircuitry is found in the I/O Unit.

[2668]FIG. 188 shows the data flow and relationship between componentsof the I/O Unit where: Logic₁: Cycle AND (CMD = ROR OutBit)

[2669] The Serial I/O unit contains the circuitry for communicatingexternally with the external world via the Data pin. The InBitUsedcontrol signal must be set by whichever unit consumes the InBit during agiven clock cycle (which can be any state of Cycle). The two VAL unitsare validation units connected to the Tamper Prevention and Detectioncircuitry, each with an OK bit. The OK bit is set to 1 on RESET, andORed with the ChipOK values from both Tamper Detection Lines each cycle.The OK bit is ANDed with each data bit that passes through the unit.

[2670] In the case of VAL₁, the effective bit output from the chip willalways be 0 if the chip has been tampered with. Thus no useful outputcan be generated by an attacker. In the case of VAL₂, the effective bitinput to the chip will always be 0 if the chip has been tampered with.Thus no useful input can be chosen by an attacker. There is no need toverify the registers in the I/O Unit since an attacker does not gainanything by destroying or modifying them.

[2671] ALU

[2672]FIG. 189 illustrates a schematic block diagram of the ArithmeticLogic Unit. The Arithmetic Logic Unit (ALU) contains a 32-bit Acc(Accumulator) register as well as the circuitry for simple arithmeticand logical operations. The ALU and all sub-units must be implementedwith non-flashing CMOS since the key passes through it. In addition, theAccumulator must be parity-checked. The logic and registers contained inthe ALU must be covered by both Tamper Detection Lines. This is toensure that keys and intermediate calculation values cannot be changedby an attacker. A 1-bit Z register contains the state of zero-ness ofthe Accumulator. Both the Z and Accumulator registers are cleared to 0upon a RESET. The Z register is updated whenever the Accumulator isupdated, and the Accumulator is updated for any of the commands: LD,LDK, LOG, XOR, ROR, RPL, and ADD. Each arithmetic and logical blockoperates on two 32-bit inputs: the current value of the Accumulator, andthe current 32-bit output of the MU. Where: Logic₁: Cycle AND CMD₇ AND(CMD₆₋₄ ≠ ST)

[2673] Since the WriteEnables of Acc and Z takes CMD₇ and Cycle intoaccount (due to Logic₁), these two bits are not required by themultiplexor MX₁ in order to select the output. The output selection forMX₁ only requires bits 6-3 of CMD and is therefore simpler as a result.Output CMD₆₋₃ MX₁ ADD ADD AND LOG AND OR LOG OR XOR XOR RPL RPL ROR RORFrom MU LD or LDK

[2674] The two VAL units are validation units connected to the TamperPrevention and Detection circuitry, each with an OK bit. The OK bit isset to 1 on RESET, and ORed with the ChipOK values from both TamperDetection Lines each cycle. The OK bit is ANDed with each data bit thatpasses through the unit. In the case of VAL₁ the effective bit outputfrom the Accumulator will always be 0 if the chip has been tamperedwith. This prevents an attacker from processing anything involving theAccumulator. VAL₁ also performs a parity check on the Accumulator,setting the Erase Tamper Detection Line if the check fails. In the caseof VAL₂, the effective Z status of the Accumulator will always be trueif the chip has been tampered with. Thus no looping constructs can becreated by an attacker. The remaining function blocks in the ALU aredescribed as follows. All must be implemented in non-flashing CMOS.Block Description OR Takes the 32-bit output from the multiplexor MX₁,ORs all 32 bits together to get 1 bit. ADD Outputs the result of theaddition of its two inputs, modulo 2³². AND Outputs the 32-bit result ofa parallel bitwise AND of its two 32-bit inputs. OR Outputs the 32-bitresult of a parallel bitwise OR of its two 32-bit inputs. XOR Outputsthe 32-bit result of a parallel bitwise XOR of its two 32-bit inputs.RPL Examined in further detail below. ROR Examined in further detailbelow.

[2675] RPL

[2676]FIG. 190 illustrates a schematic block diagram of the RPL unit.The RPL unit is a component within the ALU. It is designed to implementthe RPLCMP functionality of the Authentication Chip. The RPLCMP commandis specifically designed for use in secure writing to Flash memory M,based upon the values in AccessMode. The RPL unit contains a 32-bitshift register called AMT (AccessModeTemp), which shifts right two bitseach shift pulse, and two 1-bit registers called EE and DE, directlybased upon the WR pseudocode's EqEncountered and DecEncountered flags.All registers are cleared to 0 upon a RESET. AMT is loaded with the 32bit AM value (via the Accumulator) with a RPL INIT command, and EE andDE are set according to the general write algorithm via calls to RPL MHIand RPL MLO. The EQ and LT blocks have functionality exactly asdocumented in the WR command pseudocode. The EQ block outputs 1 if the 216-bit inputs are bit-identical and 0 if they are not. The LT blockoutputs 1 if the upper 16-bit input from the Accumulator is less thanthe 16-bit value selected from the MU via MX₂. The comparison isunsigned. The bit patterns for the operands are specifically chosen tomake the combinatorial logic simpler. The bit patterns for the operandsare listed again here since we will make use of the patterns: OperandCMD₃₋₀ Init 0000 MLO 1110 MHI 1111

[2677] The MHI and MLO have the hi bit set to easily differentiate themfrom the Init bit pattern, and the lowest bit can be used todifferentiate between MHI and MLO. The EE and DE flags must be updatedeach time the RPL command is issued. For the Init stage, we need tosetup the two values with 0, and for MHI and MLO, we need to update thevalues of EE and DE appropriately. The WriteEnable for EE and DE istherefore: Logic₁: Cycle AND (CMD⁷⁻⁴ = RPL)

[2678] With the 32 bit AMT register, we want to load the register withthe contents of AM (read from the MU) upon an RPL Init command, and toshift the AMT register right two bit positions for the RPL MLO and RPLMHI commands. This can be simply tested for with the highest bit of theRPL operand (CMD₃). The WriteEnable and ShiftEnable for the AMT registeris therefore: Logic₂ Logic₁ AND CMD₃ Logic₃ Logic₁ AND ˜CMD₃

[2679] The output from Logic₃ is also useful as input to multiplexorMX₁, since it can be used to gate through either the current 2 accessmode bits or 00 (which results in a reset of the DE and EE registerssince it represents the access mode RW). Consequently MX₁ is: OutputLogic₃ MX₁ AMT output 0 00 1

[2680] The RPL logic only replaces the upper 16 bits of the Accumulator.The lower 16 bits pass through untouched. However, of the 32 bits fromthe MU (corresponding to one of M[0-15]), only the upper or lower 16bits are used. Thus MX₂ tests CMD₀ to distinguish between MHI and MLO.Output CMD₀ MX₂ Lower 16 bits 0 Upper 16 bits 1

[2681] The logic for updating the DE and EE registers matches thepseudocode of the WR command. Note that an input of an AccessMode valueof 00 (=RW which occurs during an RPL INIT) causes both DE and EE to beloaded with 0 (the correct initialization value). EE is loaded with theresult from Logic₄, and DE is loaded with the result from Logic₅. Logic₄(((AccessMode = MSR) AND EQ) OR ((AccessMode = NMSR) AND EE AND EQ))Logic₅ (((AccessMode = MSR) AND LT) OR ((AccessMode = NMSR) AND DE) OR((AccessMode = NMSR) AND EQ AND LT))

[2682] The upper 16 bits of the Accumulator must be replaced with thevalue that is to be written to M. Consequently Logic₆ matches the WEflag from the WR command pseudocode. Logic₆ ((AccessMode = RW) OR((AccessMode = MSR) AND LT) OR ((AccessMode = NMSR) AND (DE OR LT)))

[2683] The output from Logic₆ is used directly to drive the selectionbetween the original 16 bits from the Accumulator and the value fromM[0-15] via multiplexor MX₃. If the 16 bits from the Accumulator areselected (leaving the Accumulator unchanged), this signifies that theAccumulator value can be written to M[n]. If the 16-bit value from M isselected (changing the upper 16 bits of the Accumulator), this signifiesthat the 16-bit value in M will be unchanged. MX₃ therefore takes thefollowing form: Output Logic₆ MX₃ 16 bits from 0 MU 16 bits from 1 Acc

[2684] There is no point parity checking AMT as an attacker is betteroff forcing the input to MX₃ to be 0 (thereby enabling an attacker towrite any value to M). However, if an attacker is going to go to thetrouble of laser-cutting the chip (including all Tamper Detection testsand circuitry), there are better targets than allowing the possibilityof a limited chosen-text attack by fixing the input of MX₃.

[2685] ROR

[2686]FIG. 191 illustrates a schematic block diagram of the ROR block ofthe ALU. The ROR unit is a component within the ALU. It is designed toimplement the ROR functionality of the Authentication Chip. A 1-bitregister named RTMP is contained within the ROR unit. RTMP is cleared to0 on a RESET, and set during the ROR RB and ROR XRB commands. The RTMPregister allows implementation of Linear Feedback Shift Registers withany tap configuration. The XOR block is a 2 single-bit input, 1-bit outXOR. The RORn, blocks are shown for clarity, but in fact would behardwired into multiplexor MX₃, since each block is simply a rewiring ofthe 32-bits, rotated right N bits. All 3 multiplexors (MX₁, MX₂, andMX₃) depend upon the 8-bit CMD value. However, the bit patterns for theROR op-code are arranged for logic optimization purposes. The bitpatterns for the operands are listed again here since we will make useof the patterns: Operand CMD³⁻⁰ InBit 0000 OutBit 0001 RB 0010 XRB 0011IST 0100 ISW 0101 MTRZ 0110  1 0111  2 1001 27 1010 31 1100

[2687] Logic₁ is used to provide the WriteEnable signal to RTMP. TheRTMP register should only be written to during ROR RB and ROR XRBcommands. Logic₂ is used to provide the control signal whenever theInBit is consumed. The two combinatorial logic blocks are: Logic₁: CycleAND (CMD⁷⁻⁴ = ROR) AND (CMD³⁻¹ = 001) Logic₂: Cycle AND (CMD⁷⁻⁰ = RORInBit)

[2688] With multiplexor MX₁, we are selecting the bit to be stored inRTMP. Logic₁ already narrows down the CMD inputs to one of RB and XRB.We can therefore simply test CMD₀ to differentiate between the two. Thefollowing table expresses the relationship between CMD₀ and the valueoutput from MX₁. Output CMD₀ MX₁ Acc₀ 0 XOR output 1

[2689] With multiplexor MX₂, we are selecting which input bit is goingto replace bit 0 of the Accumulator input. We can only perform a smallamount of optimization here, since each different input bit typicallyrelates to a specific operand. The following table expresses therelationship between CMD₃₋₀ and the value output from MX₂. Output CMD³⁻⁰Comment MX₂ Acc₀ 1xxx OR 111 1, 2, 27, 31 RTMP 001x RB, XRB InBit 000xInBit, OutBit MU₀ 010x IST, ISW MTRZ 110 MTRZ

[2690] The final multiplexor, MX₃, does the final rotating of the 32-bitvalue. Again, the bit patterns of the CMD operand are taken advantageof: Output CMD³⁻⁰ Comment MX₃ ROR 1 0xxx All except 2, 27, and 31 ROR 21xx1  2 ROR 27 1x1x 27 ROR 31 11xx 31

[2691] MinTicks Unit

[2692]FIG. 192 shows the data flow and relationship between componentsof the MinTicks Unit. The MinTicks Unit is responsible for aprogrammable minimum delay (via a countdown) between key-basedoperations within the Authentication Chip. The logic and registerscontained in the MinTicksUnit must be covered by both Tamper DetectionLines. This is to ensure that an attacker cannot change the time betweencalls to key-based functions. Nearly all of the MinTicks Unit can beimplemented with regular CMOS, since the key does not pass through mostof this unit. However the Accumulator is used in the SET MTRinstruction. Consequently this tiny section of circuitry must beimplemented in non-flashing CMOS. The remainder of the MinTicks Unitdoes not have to be implemented with non-flashing CMOS. However, theMTRZ latch (see below) needs to be parity checked.

[2693] The MinTicks Unit contains a 32-bit register named MTR(MinTicksRemaining) The MTR register contains the number of clock ticksremaining before the next key-based function can be called. Each cycle,the value in MTR is decremented by 1 until the value is 0. Once MTR hits0, it does not decrement any further. An additional one-bit registernamed MTRZ (MinTicksRegisterZero) reflects the current zero-ness of theMTR register. MTRZ is 1 if the MTRZ register is 0, and MTRZ is 0 if theMTRZ register is not 0. The MTR register is cleared by a RESET, and setto a new count via the SET MTR command, which transfers the currentvalue in the Accumulator into the MTR register. Where: Logic₁ CMD = SETMTR

[2694] And: Output Logic₁ MTRZ MX₁ Ace 1 — MTR-1 0 0 0 0 1

[2695] Since Cycle is connected to the WriteEnables of MTR and MTRZ,these registers only update during the Execute cycle, i.e. when Cycle=1.The two VAL units are validation units connected to the TamperPrevention and Detection circuitry, each with an OK bit. The OK bit isset to 1 on RESET, and ORed with the ChipOK values from both TamperDetection Lines each cycle. The OK bit is ANDed with each data bit thatpasses through the unit. In the case of VAL₁ the effective output fromMTR is 0, which means that the output from the decrementor unit is all1s, thereby causing MTRZ to remain 0, thereby preventing an attackerfrom using the key-based functions. VAL₁ also validates the parity ofthe MTR register. If the parity check fails, the Erase Tamper DetectionLine is triggered. In the case of VAL₂, if the chip has been tamperedwith, the effective output from MTRZ will be 0, indicating that theMinTicksRemaining register has not yet reached 0, thereby preventing anattacker from using the key-based functions.

[2696] Program Counter Unit

[2697]FIG. 192 is a block diagram of the Program Counter Unit. TheProgram Counter Unit (PCU) includes the 9 bit PC (Program Counter), aswell as logic for branching and subroutine control. The Program CounterUnit can be implemented with regular CMOS, since the key does not passthrough this unit. It does not have to be implemented with non-flashingCMOS. However, the latches need to be parity-checked. In addition, thelogic and registers contained in the Memory Unit must be covered by bothTamper Detection Lines to ensure that the PC cannot be changed by anattacker. The PC is actually implemented as a 6-level by 9-bit PCA (PCArray), indexed by the 3-bit SP (Stack Pointer) register. The PC and SPregisters are all cleared to 0 on a RESET, and updated during the flowof program control according to the opcodes. The current value for thePC is output to the MU during Cycle 0 (the Fetch cycle). The PC isupdated during Cycle 1 (the Execute cycle) according on the commandbeing executed. In most cases, the PC simply increments by 1. However,when branching occurs (due to subroutine or some other form of jump),the PC is replaced by a new value. The mechanism for calculating the newPC value depends upon the opcode being processed. The ADD block is asimple adder modulo 2⁹. The inputs are the PC value and either 1 (forincrementing the PC by 1) or a 9 bit offset (with hi bit set and lower 8bits from the MU). The “+1” block takes a 3-bit input and increments itby 1 (with wrap). The “−1” block takes a 3-bit input and decrements itby 1 (with wrap). The different forms of PC control are as follows:Command Action JSR, Save old value of PC onto stack for later. JSI (ACC)New PC is 9 bit value where bit0 = 0 (subroutines must therefore startat an even address), and upper 8 bits of address come from MU (MU 8-bitvalue is Jump Table 1 for JSR, and Jump Table 2 for JSI) JSI RTS Pop oldvalue of PC from stack and increment by 1 to get new PC. TBR If the Zflag matches the TRB test, replace PC by 9 bit value where bit0 = 0 andupper 8 bits come from MU. Otherwise increment current PC by 1. DBR C1,Add 9 bit offset (8 bit value from MU and hi bit = 1) DBR C2 to currentPC only if the C1Z or C2Z is set (C1Z for DBR C1, C2Z for DBR C2).Otherwise increment current PC by 1. All others Increment current PC by1.

[2698] Since the same action takes place for JSR, and JSI (ACC), wespecifically detect that case in Logic₁. By the same concept, we canspecifically test for the JSI RTS case in Logic₂. Logic₁ (CMD⁷⁻⁵ = 001)OR (CMD₇₋₃ = 01001) Logic₂ CMD⁷⁻³ = 01000

[2699] When updating the PC, we must decide if the PC is to be replacedby a completely new item, or by the result of the adder. This is thecase for JSR and JSI (ACC), as well as TBR as long as the test bitmatches the state of the Accumulator. All but TBR is tested for byLogic₁, so Logic₃ also includes the output of Logic₁ as its input. Theoutput from Logic₃ is then used by multiplexors MX₂ to obtain the new PCvalue. Logic₃ Logic₁ OR ((CMD⁷⁻⁴ = TBR) AND (CMD₃ XOR Z))

[2700] Output Logic₃ MX₂ Output from Adder 0 Replacement value 1

[2701] The input to the 9-bit adder depends on whether we areincrementing by 1 (the usual case), or adding the offset as read fromthe MU (the DBR command). Logic₄ generates the test. The output fromLogic₄ is then directly used by multiplexor MX₃ accordingly. Logic₄((CMD⁷⁻³ = DBR C1) AND C1Z) OR (CMD⁷⁻³ = DBR C2) AND C2Z))

[2702] Output Logic₄ MX₃ Output from Adder 0 Replacement value 1

[2703] Finally, the selection of which PC entry to use depends on thecurrent value for SP. As we enter a subroutine, the SP index value mustincrement, and as we return from a subroutine, the SP index value mustdecrement. In all other cases, and when we want to fetch a command(Cycle 0), the current value for the SP must be used. Logic₁ tells uswhen a subroutine is being entered, and Logic₂ tells us when thesubroutine is being returned from. The multiplexor selection istherefore defined as follows: Output Cycle/Logic₁/Logic₂ MX₁ SP−1 1x1SP+1 11x SP 0xx OR 00

[2704] The two VAL units are validation units connected to the TamperPrevention and Detection circuitry), each with an OK bit. The OK bit isset to 1 on RESET, and ORed with the ChipOK values from both TamperDetection Lines each cycle. The OK bit is ANDed with each data bit thatpasses through the unit. Both VAL units also parity-check the data bitsto ensure that they are valid. If the parity-check fails, the EraseTamper Detection Line is triggered. In the case of VAL₁, the effectiveoutput from the SP register will always be 0. If the chip has beentampered with. This prevents an attacker from executing anysubroutines.In the case of VAL₂, the effective PC output will always be0 if the chip has been tampered with. This prevents an attacker fromexecuting any program code.

[2705] Memory Unit

[2706] The Memory Unit (MU) contains the internal memory of theAuthentication Chip. The internal memory is addressed by 9 bits ofaddress, which is passed in from the Address Generator Unit. The MemoryUnit outputs the appropriate 32-bit and 8-bit values according to theaddress. The Memory Unit is also responsible for the special ProgrammingMode, which allows input of the program Flash memory. The contents ofthe entire Memory Unit must be protected from tampering. Therefore thelogic and registers contained in the Memory Unit must be covered by bothTamper Detection Lines. This is to ensure that program code, keys, andintermediate data values cannot be changed by an attacker. All Flashmemory needs to be multi-state, and must be checked upon being read forinvalid voltages. The 32-bit RAM also needs to be parity-checked. The32-bit data paths through the Memory Unit must be implemented withnon-flashing CMOS since the key passes along them. The 8-bit data pathscan be implemented in regular CMOS since the key does not pass alongthem.

[2707] Constants

[2708] The Constants memory region has address range:000000000-000001111. It is therefore the range 00000xxxx. However, giventhat the next 48 addresses are reserves, this can be taken advantage ofduring decoding. The Constants memory region can therefore be selectedby the upper 3 bits of the address (Adr₈₋₆=000), with the lower 4 bitsfed into combinatorial logic, with the 4 bits mappong to 32-bit outputvalues as follows: Adr³⁻⁰ Output Value 0000 0x00000000 0001 0x363636360010 0x5C5C5C5C 0011 0xFFFFFFFF 0100 0x5A827999 0101 0x6ED9EBA1 01100x8F1BBCDC 0111 0xCA62C1D6 1000 0x67452301 1001 0xEFCDAB89 10100x98BADCFE 1011 0x10325476 11xx 0xC3D2E1F0

[2709] RAM

[2710] The address space for the 32 entry 32-bit RAM is001000000-001011111. It is therefore the range 0010xxxxx. The RAM memoryregion can therefore be selected by the upper 4 bits of the address(Adr₈₋₅=0010), with the lower 5 bits sedecting which of the 32 values toaddress. Given the contiguous 32-entry address space, the RAM can easilybe implemented as a simple 32×32-bit RAM. Although the CPU treats eachaddress from the range 00000-11111 in special ways, the RAM addressdecoder itself treats no address specially. All RAM values are clearedto 0 upon a RESET, although any program code should not take this forgranted.

[2711] Flash Memory—Variables

[2712] The address space for the 32-bit wide Flash memory is001100000-001111111. It is therefore the range 0011xxxxx. The Flashmemory region can therefore be selected by the upper 4 bits of theaddress (Adr₈₋₅=0111), with the lower 5 bits selecting which value toaddress. The Flash memory has special requirements for erasure. It takesquite some time for the erasure of Flash memory to complete. The Waitsignal is therefore set inside the Flash controller upon receipt of aCLR command, and is only cleared once the requested memory has beenerased. Internally, the erase lines of particular memory ranges are tiedtogether, so that only 2 bits are required as indicated by the followingtable: Adr⁴⁻³ Erases range 00 R₀₋₄ 01 MT, AM, K1₀₋₄, K2₀₋₄ 10 IndividualM address (Adr) 11 IST, ISW

[2713] Flash values are unchanged by a RESET, although program codeshould not take the initial values for Flash (after manufacture) otherthan garbage. Operations that make use of Flash addresses are LD, ST,ADD, RPL, ROR, CLR, and SET. In all cases, the operands and the memoryplacement are closely linked, in order to minimize the addressgeneration and decoding. The entire variable section of Flash memory isalso erased upon entering Programming Mode, and upon detection of adefinite physical Attack.

[2714] Flash Memory—Program

[2715] The address range for the 384 entry 8-bit wide program Flashmemory is 010000000-111111111. It is therefore the range01xxxxxxx-11xxxxxxx. Decoding is straightforward given the ROM startaddress and address range. Although the CPU treats parts of the addressrange in special ways, the address decoder itself treats no addressspecially. Flash values are unchanged by a RESET, and are cleared onlyby entering Programming Mode. After manufacture, the Flash contents mustbe considered to be garbage. The 384 bytes can only be loaded by theState machine when in Programming Mode.

[2716] Block Diagram of MU

[2717]FIG. 193 is a block diagram of the Memory Unit. The logic showntakes advantage of the fact that 32-bit data and 8-bit data are requiredby separate commands, and therefore fewer bits are required fordecoding. As shown, 32-bit output and 8-bit output are always generated.The appropriate components within the remainder of the AuthenticationChip simply use the 32-bit or 8-bit value depending on the command beingexecuted. Multiplexor MX₁, selects the 32-bit output from a choice ofTruth Table constants, RAM, and Flash memory. Only 2 bits are requiredto select between these 3 outputs, namely Adr₆ and Adr₅. Thus MX₂takesthe following form: Output Adr⁶⁻⁵ MX₂ Output from 32-bit Truth 00 TableOutput from 32-bit Flash 10 memory Output from 32-bit RAM 11

[2718] The logic for erasing a particular part of the 32-bit Flashmemory is satisfied by Logic₁. The Erase Part control signal should onlybe set during a CLR command to the correct part of memory while Cycle=1.Note that a single CLR command may clear a range of Flash memory. Adr₆is sufficient as an address range for CLR since the range will always bewithin Flash for valid operands, and 0 for non-valid operands. Theentire range of 32-bit wide Flash memory is erased when the EraseDetection Lines is triggered (either by an attacker, or by deliberatelyentering Programming Mode). Logic₁ Cycle AND (CMD⁷⁻⁴ = CLR) AND Adr₆

[2719] The logic for writing to a particular part of Flash memory issatisfied by Logic₂. The WriteEnable control signal should only be setduring an appropriate ST command to a Flash memory range while Cycle=1.Testing only Adr₆₋₅ is acceptable since the ST command only validlywrites to Flash or RAM (if Adr₆₋₅ is 00, K2MX must be 0). Logic₂ CycleAND (CMD⁷⁻⁴ = ST) AND (Adr⁶⁻⁵ = 10)

[2720] The WE (WriteEnable) flag is set during execution of the SET WEand CLR WE commands. Logic₃ tests for these two cases. The actual bitwritten to WE is CMD₄. Logic₃ Cycle AND (CMD⁷⁻⁵ = 011) AND (CMD³⁻⁰ =0000)

[2721] The logic for writing to the RAM region of memory is satisfied byLogic₄. The WriteEnable control signal should only be set during anappropriate ST command to a RAM memory range while Cycle=1. However thisis tempered by the WE flag, which governs whether writes to X[N] arepermitted. The X[N] range is the upper half of the RAM, so this can betested for using Adr₄. Testing only Adr₆₋₅ as the full address range ofRAM is acceptable since the ST command only writes to Flash or RAM.Logic₄ Cycle AND (CMD⁷⁻⁴ = ST) AND (Adr⁶⁻⁵ = 11) AND ((Adr₄ AND WE) OR(˜Adr₄))

[2722] The three VAL units are validation units connected to the TamperPrevention and Detection circuitry, each with an OK bit. The OK bit isset to 1 on RESET, and ORed with the ChipOK values from both TamperDetection Lines each cycle. The OK bit is ANDed with each data bit thatpasses through the unit. The VAL units also check the data bits toensure that they are valid. VAL₁ and VAL₂ validate by checking the stateof each data bit, and VAL₃ performs a parity check. If any validity testfails, the Erase Tamper Detection Line is triggered. In the case ofVAL₁, the effective output from the program Flash will always be 0(interpreted as TBR 0) if the chip has been tampered with. This preventsan attacker from executing any useful instructions. In the case of VAL₂,the effective 32-bit output will always be 0 if the chip has beentampered with. Thus no key or intermediate storage value is available toan attacker. The 8-bit Flash memory is used to hold the program code,jump tables and other program information. The 384 bytes of ProgramFlash memory are selected by the full 9 bits of address (using addressrange 01xxxxxxx-11xxxxxxx). The Program Flash memory is erased only whenthe Erase Detection Lines is triggered (either by an attacker, or byentering Programming Mode due to the Programming Mode Detection Unit).When the Erase Detection Line is triggered, a small state machine in theProgram Flash Memory Unit erases the 8-bit Flash memory, validates theerasure, and loads in the new contents (384 bytes) from the serialinput. The following pseudocode illustrates the state machine logic thatis executed when the Erase Detection line is triggered:

[2723] Set WAIT output bit to prevent the remainder of the chip fromfunctioning

[2724] Fix 8-bit output to be 0

[2725] Erase all 8-bit Flash memory Temp

0 For Adr = 0 to 383 Temp

Temp OR Flash_(Adr) IF (Temp ≠ 0) Hang For Adr = 0 to 383 Do 8 timesWait for InBitValid to be set ShiftRight [Temp, InBit] Set InBitUsedcontrol signal Flash_(Adr)

Temp Hang

[2726] During the Programming Mode state machine execution, 0 must beplaced onto the 8-bit output. A 0 command causes the remainder of theAuthentication chip to interpret the command as a TBR 0. When the chiphas read all 384 bytes into the Program Flash Memory, it hangs (loopsindefinitely). The Authentication Chip can then be reset and the programused normally. Note that the erasure is validated by the same 8-bitregister that is used to load the new contents of the 8-bit programFlash memory. This helps to reduce the chances of a successful attack,since program code can't be loaded properly if the register used tovalidate the erasure is destroyed by an attacker. In addition, theentire state machine is protected by both Tamper Detection lines.

[2727] Address Generator Unit

[2728] The Address Generator Unit generates effective addresses foraccessing the Memory Unit (MU). In Cycle 0, the PC is passed through tothe MU in order to fetch the next opcode. The Address Generatorinterprets the returned opcode in order to generate the effectiveaddress for Cycle 1. In Cycle 1, the generated address is passed to theMU. The logic and registers contained in the Address Generator Unit mustbe covered by both Tamper Detection Lines. This is to ensure that anattacker cannot alter any generated address. Nearly all of the AddressGenerator Unit can be implemented with regular CMOS, since the key doesnot pass through most of this unit. However 5 bits of the Accumulatorare used in the JSI Address generation. Consequently this tiny sectionof circuitry must be implemented in non-flashing CMOS. The remainder ofthe Address Generator Unit does not have to be implemented withnon-flashing CMOS. However, the latches for the counters and calculatedaddress should be parity-checked. If either of the Tamper DetectionLines is broken, the Address Generator Unit will generate address 0 eachcycle and all counters will be fixed at 0. This will only come intoeffect if an attacker has disabled the RESET and/or erase circuitry,since under normal circumstances, breaking a Tamper Detection Line willresult in a RESET or the erasure of all Flash memory.

[2729] Background to Address Generation

[2730] The logic for address generation requires an examination of thevarious opcodes and operand combinations. The relationship betweenopcode/operand and address is examined in this section, and is used asthe basis for the Address Generator Unit.

[2731] Constants

[2732] The lower 4 entries are the simple constants for general-purposeuse as well as the HMAC algorithm. The lower 4 bits of the LDK operanddirectly correspond to the lower 3 bits of the address in memory forthese 4 values, i.e. 0000, 0001, 0010, and 0011 respectively. The yconstants and the h constants are also addressed by the LDK command.However the address is generated by ORing the lower 3 bits of theoperand with the inverse of the C1 counter value, and keeping the 4thbit of the operand intact. Thus for LDK y, the y operand is 0100, andwith LDK h, the h operand is 1000. Since the inverted C1 value takes onthe range 000-011 for y, and 000-100 for h, the ORed result gives theexact address. For all constants, the upper 5 bits of the final addressare always 00000.

[2733] RAM

[2734] Variables A-T have addresses directly related to the lower 3 bitsof their operand values. That is, for operand values 0000-0101 of theLD, ST, ADD, LOG, and XOR commands, as well as operand vales 1000-1101of the LOG command, the lower 3 operand address bits can be usedtogether with a constant high 6-bit address of 001000 to generate thefinal address. The remaining register values can only be accessed via anindexed mechanism. Variables A-E, B160, and H are only accessible asindexed by the C1 counter value, while X is indexed by N₁, N₂, N₃, andN₄. With the LD, ST and ADD commands, the address for AE as indexed byC1 can be generated by taking the lower 3 bits of the operand (000) andORing them with the C1 counter value. However, H and B160 addressescannot be generated in this way, (otherwise the RAM address space wouldbe non-contiguous). Therefore simple combinatorial logic must convert AEinto 0000, H into 0110, and B160 into 1011. The final address can beobtained by adding C1 to the 4-bit value (yielding a 4-bit result), andprepending the constant high 5-bit address of 00100. Finally, the Xrange of registers is only accessed as indexed by N₁, N₂, N₃, and N₄.With the XOR command, any of N₁₋₄ can be used to index, while with LD,ST, and ADD, only N₄ can be used. Since the operand of X in LD, ST, andADD is the same as the X_(N4) operand, the lower 2 bits of the operandselects which N to use. The address can thus be generated as a constanthigh 5-bit value of 00101, with the lower 4 bits coming from by theselected N counter.

[2735] Flash Memory—Variables

[2736] The addresses for variables MT and AM can be generated from theoperands of associated commands. The 4 bits of operand can be useddirectly (0110 and 0111), and prepending the constant high 5-bit addressof 00110. Variables R₁₋₅, K1₁₋₅, K2₁₋₅, and M₀₋₇ are only accessible asindexed by the inverse of the C1 counter value (and additionally in thecase of R, by the actual C1 value). Simple combinatorial logic mustconvert R and RF into 00000, K into 01000 or 11000 depending on whetherK1 or K2 is being addressed, and M (including MHI and MLO) into 10000.The final address can be obtained by ORing (or adding) C1 (or in thecase of RF, using C1 directly) with the 5-bit value, and prepending theconstant high 4-bit address of 0011. Variables IST and ISW are each only1 bit of value, but can be implemented by any number of bits. Data isread and written as either 0x00000000 or 0xFFFFFFFF. They are addressedonly by ROR, CLR and SET commands. In the case of ROR, the low bit ofthe operand is combined with a constant upper 8-bits value of 00111111,yielding 001111110 and 001111111 for IST and ISW respectively. This isbecause none of the other ROR operands make use of memory, so in casesother than IST and ISW, the value returned can be ignored. With SET andCLR, IST and ISW are addressed by combining a constant upper 4-bits of0011 with a mapping from IST (0100) to 11110 and from ISW (0101) to11111. Since IST and ISW share the same operand values with E and T fromRAM, the same decoding logic can be used for the lower 5 bits. The finaladdress requires bits 4, 3, and 1 to be set (this can be done by ORingin the result of testing for operand values 010x).

[2737] Flash Memory—Program

[2738] The address to lookup in program Flash memory comes directly fromthe 9-bit PC (in Cycle 0) or the 9-bit Adr register (in Cycle 1).Commands such as TBR, DBR, JSR and JSI modify the PC according to datastored in tables at specific addresses in the program memory. As aresult, address generation makes use of some constant addresscomponents, with the command operand (or the Accumulator) forming thelower bits of the effective address: Constant (upper) Variable (lower)Command Address Range part of address part of address TBR 010000xxx010000 CMD²⁻⁰ JSR 0100xxxxx 0100 CMD⁴⁻⁰ JSI ACC 0101xxxxx 0101 Acc⁴⁻⁰DBR 011000xxx 011000 CMD²⁻⁰

[2739] Block Diagram of Address Generator Unit

[2740]FIG. 194 shows a schematic block diagram for the Address GeneratorUnit. The primary output from the Address Generator Unit is selected bymultiplexor MX₁, as shown in the following table: Output Cycle MX₁ PC 0Adr 1

[2741] It is important to distinguish between the CMD data and the 8-bitdata from the MU:

[2742] In Cycle 0, the 8-bit data line holds the next instruction to beexecuted in the following Cycle 1. This 8-bit command value is used todecode the effective address. By contrast, the CMD 8-bit data holds theprevious instruction, so should be ignored.

[2743] In Cycle 1, the CMD line holds the currently executinginstruction (which was in the 8-bit data line during Cycle 0), while the8-bit data line holds the data at the effective address from theinstruction. The CMD data must be executed during Cycle 1.

[2744] Consequently, the choice of 9-bit data from the MU or the CMDvalue is made by multiplexor MX3, as shown in the following table:Output Cycle MX₃ 8-bit data from 0 MU CMD 1

[2745] Since the 9-bit Adr register is updated every Cycle 0, theWriteEnable of Adr is connected to ˜Cycle. The Counter Unit generatescounters C1, C2 (used internally) and the selected N index. In addition,the Counter Unit outputs flags C1Z and C2Z for use by the ProgramCounter Unit. The various *GEN units generate addresses for particularcommand types during Cycle 0, and multiplexor MX₂ selects between thembased on the command as read from program memory via the PC (i.e. the8-bit data line). The generated values are as follows: Block Commandsfor which address is generated JSIGEN JSI ACC JSRGEN JSR, TBR DBRGEN DBRLDKGEN LDK RPLGEN RPL VARGEN LD, ST, ADD, LOG, XOR BITGEN ROR, SETCLRGEN CLR

[2746] Multiplexor MX₂ has the following selection criteria: Output8-bit data value from MU MX₂ 9-bit value from JSIGEN 01001xxx 9-bitvalue from JSRGEN 001xxxxx OR 0000xxxx 9-bit value from DBRGEN 0001xxxx9-bit value from LDKGEN 1110xxxx 9-bit value from RPLGEN 1101xxxx 9-bitvalue from VARGEN 10xxxxxx OR 1x11xxxx 9-bit value from BITGEN 0111xxxxOR 1100xxxx 9-bit value from CLRGEN 0110xxxx

[2747] The VAL₁ unit is a validation unit connected to the TamperPrevention and Detection circuitry. It contains an OK bit that is set to1 on RESET, and ORed with the ChipOK values from both Tamper DetectionLines each cycle. The OK bit is ANDed with the 9 bits of EffectiveAddress before they can be used. If the chip has been tampered with, theaddress output will be always 0, thereby preventing an attacker fromaccessing other parts of memory. The VAL₁ unit also performs a paritycheck on the Effective Address bits to ensure it has not been tamperedwith. If the parity-check fails, the Erase Tamper Detection Line istriggered.

[2748] JSIGEN

[2749]FIG. 195 shows a schematic block diagram for the JSIGEN Unit. TheJSIGEN Unit generates addresses for the JSI ACC instruction. Theeffective address is simply the concatenation of:

[2750] the 4-bit high part of the address for the JSI Table (0101) and

[2751] the lower 5 bits of the Accumulator value.

[2752] Since the Accumulator may hold the key at other times (when ajump address is not being generated), the value must be hidden fromsight. Consequently this unit must be implemented with non-flashingCMOS. The multiplexor MX₁ simply chooses between the lower 5 bits fromAccumulator or 0, based upon whether the command is JSIGEN. MultiplexorMX₁ has the following selection criteria: Output CMD₇₋₀ MX₁Accumulator₄₋₀ JSI ACC 00000 ˜(JSI ACC)

[2753] JSRGEN

[2754]FIG. 196 shows a schematic block diagram for the JSRGEN Unit. TheJSRGEN Unit generates addresses for the JSR and TBR instructions. Theeffective address comes from the concatenation of:

[2755] the 4-bit high part of the address for the JSR table (0100),

[2756] the offset within the table from the operand (5 bits for JSRcommands, and 3 bits plus a constant 0 bit for TBR).

[2757] where Logic₁ produces bit 3 of the effective address. This bitshould be bit 3 in the case of JSR, and 0 in the case of TBR: Logic₁bit₅ AND bit₃

[2758] Since the JSR instruction has a 1 in bit 5, (while TBR is 0 forthis bit) ANDing this with bit 3 will produce bit 3 in the case of JSR,and 0 in the case of TBR.

[2759] DBRGEN

[2760]FIG. 197 shows a schematic block diagram for the DBRGEN Unit. TheDBRGEN Unit generates addresses for the DBR instructions. The effectiveaddress comes from the concatenation of:

[2761] the 6-bit high part of the address for the DBR table (011000),and

[2762] the lower 3 bits of the operand

[2763] LDKGEN

[2764]FIG. 198 shows a schematic block diagram for the LDKGEN Unit. TheLDKGEN Unit generates addresses for the LDK instructions. The effectiveaddress comes from the concatenation of:

[2765] the 5-bit high part of the address for the LDK table (00000),

[2766] the high bit of the operand, and

[2767] the lower 3 bits of the operand (in the case of the lowerconstants), or the lower 3 bits of the operand ORed with C1 (in the caseof indexed constants).

[2768] The OR₂ block simply ORs the 3 bits of C1 with the 3 lowest bitsfrom the 8-bit data output from the MU. The multiplexor MX₁ simplychooses between the actual data bits and the data bits ORed with C1,based upon whether the upper bits of the operand are set or not. Theselector input to the multiplexor is a simple OR gate, ORing bit₂ withbit₃. Multiplexor MX₁ has the following selection criteria: Output bit₃OR bit₂ MX₁ bit₂₋₀ 0 Output from OR block 1

[2769] RPLGEN

[2770]FIG. 199 shows a schematic block diagram for the RPLGEN Unit. TheRPLGEN Unit generates addresses for the RPL instructions. When K2MX is0, the effective address is a constant 000000000. When K2MX is 1(indicating reads from M return valid values), the effective addresscomes from the concatenation of:

[2771] the 6-bit high part of the address for M (001110), and

[2772] the 3 bits of the current value for C1

[2773] The multiplexor MX₁ chooses between the two addresses, dependingon the current value of K2MX. Multiplexor MX₁ therefore has thefollowing selection criteria: Output K2MX MX₁ 000000000 0 001110 | C1 1

[2774] VARGEN

[2775]FIG. 200 shows a schematic block diagram for the VARGEN Unit. TheVARGEN Unit generates addresses for the LD, ST, ADD, LOG, and XORinstructions. The K2MX 1-bit flag is used to determine whether readsfrom M are mapped to the constant 0 address (which returns 0 and cannotbe written to), and which of K1 and K2 is accessed when the operandspecifies K. The 4-bit Adder block takes 2 sets of 4-bit inputs, andproduces a 4-bit output via addition modulo 2⁴. The single bit registerK2MX is only ever written to during execution of a CLR K2MX or a SETK2MX instruction. Logic₁ sets the K2MX WriteEnable based on theseconditions: Logic₁ Cycle AND bit₇₋₀ = 011x0001

[2776] The bit written to the K2MX variable is 1 during a SETinstruction, and 0 during a CLR instruction. It is convenient to use thelow order bit of the opcode (bit₄) as the source for the input bit.During address generation, a Truth Table implemented as combinatoriallogic determines part of the base address as follows: bit₇₋₄ bit₃₋₀Description Output Value LOG x A, B, C, D, E, T, MT, 00000 AM ≠ LOG 0xxxOR 1x00 A, B, C, D, E, T, MT, 00000 AM, AE[C1], RE[C1] ≠ LOG 1001 B16001011 ≠ LOG 1010 H 00110 ≠ LOG 111x X, M 10000 ≠ LOG 1101 K K2MX | 1000

[2777] Although the Truth Table produces 5 bits of output, the lower 4bits are passed to the 4-bit Adder, where they are added to the indexvalue (C1, N or the lower 3 bits of the operand itself). The highest bitpasses the adder, and is prepended to the 4-bit result from the adderresult in order to produce a 5-bit result. The second input to the addercomes from multiplexor MX₁, which chooses the index value from C1, N,and the lower 3 bits of the operand itself). Although C1 is only 3 bits,the fourth bit is a constant 0. Multiplexor MX₁ has the followingselection criteria: Output bit⁷⁻⁰ MX₁ Data²⁻⁰ (bit₃ = 0) OR (bit⁷⁻⁴ =LOG) C1 (bit₃ = 1) AND (bit²⁻⁰ = 111) AND ((bit⁷⁻⁴ = 1x11) OR (bit⁷⁻⁴ =ADD)) N ((bit₃ = 1) AND (bit⁷⁻⁴ = XOR)) OR (((bit₇₋₄ = 1x11) OR (bit⁷⁻⁴= ADD)) AND (bit³⁻⁰ = 1111))

[2778] The 6th bit (bit₅) of the effective address is 0 for RAMaddresses, and 1 for Flash memory addresses. The Flash memory addressesare MT, AM, R, K, and M. The computation for bit₅ is provided by Logic₂:Logic₂ ((bit³⁻⁰ = 110) OR (bit³⁻⁰ = 011x) OR (bit³⁻⁰ = 110x)) AND((bit⁷⁻⁴ = 1x11) OR (bit⁷⁻⁴ = ADD))

[2779] A constant 1 bit is prepended, making a total of 7 bits ofeffective address. These bits will form the effective address unlessK2MX is 0 and the instruction is LD, ADD or ST M[C1]. In the lattercase, the effective address is the constant address of 0000000. In bothcases, two 0 bits are prepended to form the final 9-bit address. Thecomputation is shown here, provided by Logic₃ and multiplexor MX₂.Logic₃ ˜K2MX AND (bit³⁻⁰ = 1110) AND ((bit⁷⁻⁴ = 1x11) OR (bit⁷⁻⁴ = ADD))

[2780] Output Logic₃ MX₂ Calculated bits 0 0000000 1

[2781] CLRGEN

[2782]FIG. 201 shows a schematic block diagram for the CLRGEN Unit. TheCLRGEN Unit generates addresses for the CLR instruction. The effectiveaddress is always in Flash memory for valid memory accessing operands,and is 0 for invalid operands. The CLR M[C1] instruction always erasesM[C1], regardless of the status of the K2MX flag (kept in the VARGENUnit). The Truth Table is simple combinatorial logic that implements thefollowing relationship: Input Value (bit³⁻⁰) Output Value 1100 00 1100000 1101 00 1101 000 1110 00 1110 | C1 1111 00 1111 110 ˜(11xx)000000000

[2783] It is a simple matter to reduce the logic required for the TruthTable since in all 4 main cases, the first 6 bits of the effectiveaddress are 00 followed by the operand (bits₃₋₀)

[2784] BITGEN

[2785]FIG. 202 shows a schematic block diagram for the BITGEN Unit. TheBITGEN Unit generates addresses for the ROR and SET instructions. Theeffective address is always in Flash memory for valid memory accessingoperands, and is 0 for invalid operands. Since ROR and SET instructionsonly access the IST and ISW Flash memory addresses (the remainder of theoperands access registers), a simple combinatorial logic Truth Tablesuffices for address generation: Input Value (bit³⁻⁰) Output Value 010x00111111 | bit₀ ˜(010x) 000000000

[2786] Counter Unit

[2787] FIG. Y37 shows a schematic block diagram for the Counter Unit.The Counter Unit generates counters C1, C2 (used internally) and theselected N index. In addition, the Counter Unit outputs flags C1Z andC2Z for use externally. Registers C1 and C2 are updated when they arethe targets of a DBR or SC instruction. The high bit of the operand(bit₃ of the effective command) gives the selection between C1 and C2.Logic₁ and Logic₂ determine the WriteEnables for C1 and C2 respectively.Logic₁ Cycle AND (bit⁷⁻³ = 0x010) Logic₂ Cycle AND (bit⁷⁻³ = 0x011)

[2788] The single bit flags C1Z and C2Z are produced by the NOR of theirmultibit C1 and C2 counterparts. Thus C1Z is 1 if C1=0, and C2Z is 1 ifC2=0. During a DBR instruction, the value of either C1 or C2 isdecremented by 1 (with wrap). The input to the Decrementor unit isselected by multiplexor MX₂ as follows: Output bit₃ MX₂ C1 0 C2 1

[2789] The actual value written to C1 or C2 depends on whether the DBRor SC instruction is being executed. Multiplexor MX₁ selects between theoutput from the Decrementor (for a DBR instruction), and the output fromthe Truth Table (for a SC instruction). Note that only the lowest 3 bitsof the 5-bit output are written to C1. Multiplexor MX₁ therefore has thefollowing selection criteria: Output bit₆ MX₁ Output from Truth 0 TableOutput from 1 Decrementor

[2790] The Truth Table holds the values to be loaded by C1 and C2 viathe SC instruction. The Truth Table is simple combinatorial logic thatimplements the following relationship: Input Value Output (bit²⁻⁰) Value000 00010 001 00011 010 00100 011 00111 100 01010 101 01111 110 10011111 11111

[2791] Registers N1, N2, N3, and N4 are updated by their next value −1(with wrap) when they are referred to by the XOR instruction. RegisterN4 is also updated when a ST X[N4] instruction is executed. LD and ADDinstructions do not update N4. In addition, all 4 registers are updatedduring a SET Nx command. Logic₄₋₇ generate the WriteEnables forregisters N1-N4. All use Logic₃, which produces a 1 if the command isSET Nx, or 0 otherwise. Logic₃ bit⁷⁻⁰ = 01110010 Logic₄ Cycle AND((bit⁷⁻⁰ = 10101000) OR Logic₃) Logic₅ Cycle AND ((bit⁷⁻⁰ = 10101001) ORLogic₃) Logic₆ Cycle AND ((bit⁷⁻⁰ = 10101010) OR Logic₃) Logic₇ CycleAND ((bit⁷⁻⁰ = 11111011) OR (bit⁷⁻⁰ = 10101011) OR Logic₃)

[2792] The actual N index value passed out, or used as the input to theDecrementor, is simply selected by multiplexor MX₄ using the lower 2bits of the operand: Output bit¹⁻⁰ MX₄ N1 00 N2 01 N3 10 N4 11

[2793] The Incrementor takes 4 bits of input value (selected bymultiplexor MX₄) and adds 1, producing a 4-bit result (due to additionmodulo 2⁴). Finally, four instances of multiplexor MX₃ select between aconstant value (different for each N, and to be loaded during the SET Nxcommand), and the result of the Decrementor (during XOR or STinstructions). The value will only be written if the appropriateWriteEnable flag is set (see Logic₄-Logic₇), so Logic₃ can safely beused for the multiplexor. Output Logic₃ MX₃ Output from 0 DecrementorConstant value 1

[2794] The SET Nx command loads N1-N4 with the following constants:Constant Initial X[N] Index Loaded referred to N1 2 X[13] N2 7 X[8] N313 X[2] N4 15 X[0]

[2795] Note that each initial X[N_(n)] referred to matches the optimizedSHA-1 algorithm initial states for indexes N1-N4. When each index valueN_(n). decrements, the effective X[N] increments. This is because the Xwords are stored in memory with most significant word first. The threeVAL units are validation units connected to the Tamper Prevention andDetection circuitry, each with an OK bit. The OK bit is set to 1 onRESET, and ORed with the ChipOK values from both Tamper Detection Lineseach cycle. The OK bit is ANDed with each data bit that passes throughthe unit. All VAL units also parity check the data to ensure thecounters have not been tampered with. If a parity check fails, the EraseTamper Detection Line is triggered. In the case of VAL₁, the effectiveoutput from the counter C1 will always be 0 if the chip has beentampered with. This prevents an attacker from executing any loopingconstructs that index through the keys. In the case of VAL₂, theeffective output from the counter C2 will always be 0 if the chip hasbeen tampered with. This prevents an attacker from executing any loopingconstructs. In the case of VAL₃, the effective output from any N counter(N1-N4) will always be 0 if the chip has been tampered with. Thisprevents an attacker from executing any looping constructs that indexthrough X.

[2796] Turning now to FIG. 203, there is illustrated 705 the informationstored within the flash memory store 701. This data can include thefollowing:

[2797] Factory Code

[2798] The factory code is a 16 bit code indicating the factory at whichthe print roll was manufactured. This identifies factories belonging tothe owner of the print roll technology, or factories making print rollsunder license. The purpose of this number is to allow the tracking offactory that a print roll came from, in case there are quality problems.

[2799] Batch Number

[2800] The batch number is a 32 bit number indicating the manufacturingbatch of the print roll. The purpose of this number is to track thebatch that a print roll came from, in case there are quality problems.

[2801] Serial Number

[2802] A 48 bit serial number is provided to allow unique identificationof each print roll up to a maximum of 280 trillion print rolls.

[2803] Manufacturing Date

[2804] A 16 bit manufacturing date is included for tracking the age ofprint rolls, in case the shelf life is limited.

[2805] Media Length

[2806] The length of print media remaining on the roll is represented bythis number. This length is represented in small units such asmillimeters or the smallest dot pitch of printer devices using the printroll and to allow the calculation of the number of remaining photos ineach of the well known C, H, and P formats, as well as other formatswhich may be printed. The use of small units also ensures a highresolution can be used to maintain synchronization with pre-printedmedia.

[2807] Media Type

[2808] The media type datum enumerates the media contained in the printroll.

[2809] (1) Transparent

[2810] (2) Opaque white

[2811] (3) Opaque tinted

[2812] (4) 3D lenticular

[2813] (5) Pre-printed: length specific

[2814] (6) Pre-printed: not length specific

[2815] (7) Metallic foil

[2816] (8) Holographic/optically variable device foil

[2817] Pre-Printed Media Length

[2818] The length of the repeat pattern of any pre-printed mediacontained, for example on the back surface of the print roll is storedhere.

[2819] Ink Viscosity

[2820] The viscosity of each ink color is included as an 8 bit number.the ink viscosity numbers can be used to adjust the print head actuatorcharacteristics to compensate for viscosity (typically, a higherviscosity will require a longer actuator pulse to achieve the same dropvolume).

[2821] Recommended Drop Volume for 1200 dpi

[2822] The recommended drop volume of each ink color is included as an 8bit number. The most appropriate drop volume will be dependent upon theink and print media characteristics. For example, the required dropvolume will decrease with increasing dye concentration or absorptivity.Also, transparent media require around twice the drop volume as opaquewhite media, as light only passes through the dye layer once fortransparent media.

[2823] As the print roll contains both ink and media, a custom match canbe obtained. The drop volume is only the recommended drop volume, as theprinter may be other than 1200 dpi, or the printer may be adjusted forlighter or darker printing.

[2824] Ink Color

[2825] The color of each of the dye colors is included and can be usedto “fine tune” the digital half toning that is applied to any imagebefore printing.

[2826] Remaining Media Length Indicator

[2827] The length of print media remaining on the roll is represented bythis number and is updatable by the camera device. The length isrepresented in small units (eg. 1200 dpi pixels) to allow calculation ofthe number of remaining photos in each of C, H, and P formats, as wellas other formats which may be printed. The high resolution can also beused to maintain synchronization with pre-printed media.

[2828] Copyright or Bit Pattern

[2829] This 512 bit pattern represents an ASCII character sequencesufficient to allow the contents of the flash memory store to becopyrightable.

[2830] Turning now to FIG. 204, there is illustrated the storage table730 of the Artcam authorization chip. The table includes manufacturingcode, batch number and serial number and date which have an identicalformat to that previously described. The table 730 also includesinformation 731 on the print engine within the Artcam device. Theinformation stored can include a print engine type, the DPI resolutionof the printer and a printer count of the number of prints produced bythe printer device.

[2831] Further, an authentication test key 710 is provided which canrandomly vary from chip to chip and is utilised as the Artcam randomidentification code in the previously described algorithm. The 128 bitprint roll authentication key 713 is also provided and is equivalent tothe key stored within the print rolls. Next, the 512 bit pattern isstored followed by a 120 bit spare area suitable for Artcam use.

[2832] As noted previously, the Artcam preferably includes a liquidcrystal display 15 which indicates the number of prints left on theprint roll stored within the Artcam. Further, the Artcam also includes athree state switch 17 which allows a user to switch between threestandard formats C H and P (classic, HDTV and panoramic). Upon switchingbetween the three states, the liquid crystal display 15 is updated toreflect the number of images left on the print roll if the particularformat selected is used.

[2833] In order to correctly operate the liquid crystal display, theArtcam processor, upon the insertion of a print roll and the passing ofthe authentication test reads the from the flash memory store of theprint roll chip 53 and determines the amount of paper left. Next, thevalue of the output format selection switch 17 is determined by theArtcam processor. Dividing the print length by the corresponding lengthof the selected output format the Artcam processor determines the numberof possible prints and updates the liquid crystal display 15 with thenumber of prints left. Upon a user changing the output format selectionswitch 17 the Artcam processor 31 re-calculates the number of outputpictures in accordance with that format and again updates the LCDdisplay 15.

[2834] The storage of process information in the printer roll table 705(FIG. 165) also allows the Artcam device to take advantage of changes inprocess and print characteristics of the print roll.

[2835] In particular, the pulse characteristics applied to each nozzlewithin the print head can be altered to take into account of changes inthe process characteristics. Turning now to FIG. 205, the ArtcamProcessor can be adapted to run a software program stored in anancillary memory ROM chip. The software program, a pulse profilecharacteriser 771 is able to read a number of variables from the printerroll. These variables include the remaining roll media on printer roll772, the printer media type 773, the ink color viscosity 774, the inkcolor drop volume 775 and the ink color 776. Each of these variables areread by the pulse profile characteriser and a corresponding, mostsuitable pulse profile is determined in accordance with prior trial andexperiment. The parameters alters the printer pulse received by eachprinter nozzle so as to improve the stability of ink output.

[2836] It will be evident that the authorization chip includessignificant advances in that important and valuable information isstored on the printer chip with the print roll. This information caninclude process characteristics of the print roll in question inaddition to information on the type of print roll and the amount ofpaper left in the print roll. Additionally, the print roll interfacechip can provide valuable authentication information and can beconstructed in a tamper proof manner. Further, a tamper resistant methodof utilising the chip has been provided. The utilization of the printroll chip also allows a convenient and effective user interface to beprovided for an immediate output form of Artcam device able to outputmultiple photographic formats whilst simultaneously able to provide anindicator of the number of photographs left in the printing device.

[2837] Print Head Unit

[2838] Turning now to FIG. 206 , there is illustrated an explodedperspective view, partly in section, of the print head unit 615 of FIG.162.

[2839] The print head unit 615 is based around the print-head 44 whichejects ink drops on demand on to print media 611 so as to form an image.The print media 611 is pinched between two set of rollers comprising afirst set 618, 616 and second set 617, 619.

[2840] The print-head 44 operates under the control of power, ground andsignal lines 810 which provides power and control for the print-head 44and are bonded by means of Tape Automated Bonding (TAB) to the surfaceof the print-head 44.

[2841] Importantly, the print-head 44 which can be constructed from asilicon wafer device suitably separated, relies upon a series ofanisotropic etches 812 through the wafer having near vertical sidewalls. The through wafer etches 812 allow for the direct supply of inkto the print-head surface from the back of the wafer for subsequentejection.

[2842] The ink is supplied to the back of the inkjet print-head 44 bymeans of ink-head supply unit 814. The inkjet print-head 44 has threeseparate rows along its surface for the supply of separate colors ofink. The ink-head supply unit 814 also includes a lid 815 for thesealing of ink channels.

[2843] In FIG. 207 to FIG. 210, there is illustrated various perspectiveviews of the ink-head supply unit 814. Each of FIG. 207 to FIG. 210illustrate only a portion of the ink head supply unit which can beconstructed of indefinite length, the portions shown so as to provideexemplary details. In FIG. 207 there is illustrated a bottom perspectiveview, FIG. 148 illustrates a top perspective view, FIG. 209 illustratesa close up bottom perspective view, partly in section, FIG. 210illustrates a top side perspective view showing details of the inkchannels, and FIG. 211 illustrates a top side perspective view as doesFIG. 212.

[2844] There is considerable cost advantage in forming ink-head supplyunit 814 from injection molded plastic instead of, say, micromachinedsilicon. The manufacturing cost of a plastic ink channel will beconsiderably less in volume and manufacturing is substantially easier.The design illustrated in the accompanying Figures assumes a 1600 dpithree color monolithic print head, of a predetermined length. Theprovided flow rate calculations are for a 100 mm photo printer.

[2845] The ink-head supply unit 814 contains all of the required finedetails. The lid 815 (FIG. 206) is permanently glued or ultrasonicallywelded to the ink-head supply unit 814 and provides a seal for the inkchannels.

[2846] Turning to FIG. 209, the cyan, magenta and yellow ink flows inthrough ink inlets 820-822, the magenta ink flows through thethroughholes 824,825 and along the magenta main channels 826,827 (FIG.141). The cyan ink flows along cyan main channel 830 and the yellow inkflows along the yellow main channel 831. As best seen from FIG. 209, thecyan ink in the cyan main channels then flows into a cyan sub-channel833. The yellow subchannel 834 similarly receiving yellow ink from theyellow main channel 831.

[2847] As best seen in FIG. 210, the magenta ink also flows from magentamain channels 826,827 through magenta throughholes 836, 837. Returningagain to FIG. 209, the magenta ink flows out of the throughholes 836,837. The magenta ink flows along first magenta subchannel e.g. 838 andthen along second magenta subchannel e.g. 839 before flowing into amagenta trough 840. The magenta ink then flows through magenta vias e.g.842 which are aligned with corresponding inkjet head throughholes (e.g.812 of FIG. 166) wherein they subsequently supply ink to inkjet nozzlesfor printing out.

[2848] Similarly, the cyan ink within the cyan subchannel 833 flows intoa cyan pit area 849 which supplies ink two cyan vias 843, 844.Similarly, the yellow subchannel 834 supplies yellow pit area 46 whichin turn supplies yellow vias 847, 848.

[2849] As seen in FIG. 210, the print-head is designed to be receivedwithin print-head slot 850 with the various vias e.g. 851 aligned withcorresponding through holes eg. 851 in the print-head wafer.

[2850] Returning to FIG. 206, care must be taken to provide adequate inkflow to the entire print-head chip 44, while satisfying the constraintsof an injection moulding process. The size of the ink through waferholes 812 at the back of the print head chip is approximately 100 μm×50μm, and the spacing between through holes carrying different colors ofink is approximately 170 μm. While features of this size can readily bemolded in plastic (compact discs have micron sized features), ideallythe wall height must not exceed a few times the wall thickness so as tomaintain adequate stiffness. The preferred embodiment overcomes theseproblems by using hierarchy of progressively smaller ink channels.

[2851] In FIG. 211, there is illustrated a small portion 870 of thesurface of the print-head 44. The surface is divided into 3 series ofnozzles comprising the cyan series 871, the magenta series 872 and theyellow series 873. Each series of nozzles is further divided into tworows eg. 875, 876 with the print-head 44 having a series of bond pads878 for bonding of power and control signals.

[2852] The print head is preferably constructed in accordance with alarge number of different forms of ink jet invented for uses includingArtcam devices. These ink jet devices are discussed in further detailhereinafter.

[2853] The print-head nozzles include the ink supply channels 880,equivalent to anisotropic etch hole 812 of FIG. 206. The ink flows fromthe back of the wafer through supply channel 881 and in turn through thefilter grill 882 to ink nozzle chambers eg. 883. The operation of thenozzle chamber 883 and print-head 44 (FIG. 1) is, as mentionedpreviously, described in the abovementioned patent specification.

[2854] Ink Channel Fluid Flow Analysis

[2855] Turning now to an analysis of the ink flow, the main ink channels826, 827, 830, 831 (FIG. 207, FIG. 141) are around 1 mm×1 mm, and supplyall of the nozzles of one color. The sub-channels 833, 834, 838, 839(FIG. 209) are around 200 μm×100 μm and supply about 25 inkjet nozzleseach. The print head through holes 843, 844, 847, 848 and wafer throughholes eg. 881 (FIG. 211) are 100 μm×50μm and, supply 3 nozzles at eachside of the print head through holes. Each nozzle filter 882 has 8slits, each with an area of 20 μm×2 μm and supplies a single nozzle.

[2856] An analysis has been conducted of the pressure requirements of anink jet printer constructed as described. The analysis is for a 1,600dpi three color process print head for photograph printing. The printwidth was 100 mm which gives 6,250 nozzles for each color, giving atotal of 18,750 nozzles.

[2857] The maximum ink flow rate required in various channels for fullblack printing is important. It determines the pressure drop along theink channels, and therefore whether the print head will stay filled bythe surface tension forces alone, or, if not, the ink pressure that isrequired to keep the print head full.

[2858] To calculate the pressure drop, a drop volume of 2.5 pl for 1,600dpi operation was utilized. While the nozzles may be capable ofoperating at a higher rate, the chosen drop repetition rate is 5 kHzwhich is suitable to print a 150 mm long photograph in an little under 2seconds. Thus, the print head, in the extreme case, has a 18,750nozzles, all printing a maximum of 5,000 drops per second. This ink flowis distributed over the hierarchy of ink channels. Each ink channeleffectively supplies a fixed number of nozzles when all nozzles areprinting.

[2859] The pressure drop Δρ was calculated according to theDarcy-Weisbach formula:${\Delta\rho} = \frac{\rho \quad U^{2}{fL}}{2D}$

[2860] Where ρ is the density of the ink, U is the average flowvelocity, L is the length, D is the hydraulic diameter, and f is adimensionless friction factor calculated as follows: $f = \frac{k}{Re}$

[2861] Where Re is the Reynolds number and k is a dimensionless frictioncoefficient dependent upon the cross section of the channel calculatedas follows: ${Re} = \frac{UD}{\nu}$

[2862] Where ν is the kinematic viscosity of the ink.

[2863] For a rectangular cross section, k can be approximated by:$\quad {k = {\frac{64}{{\frac{2}{3} + \frac{11b}{24a}}\quad}\quad \frac{11b}{24a}\quad \left( {2 - {b\text{/}a}} \right)}}$

[2864] Where a is the longest side of the rectangular cross section, andb is the shortest side. The hydraulic diameter D for a rectangular crosssection is given by: $D = \frac{2\quad {ab}}{a + b}$

[2865] Ink is drawn off the main ink channels at 250 points along thelength of the channels. The ink velocity falls linearly from the startof the channel to zero at the end of the channel, so the average flowvelocity U is half of the maximum flow velocity. Therefore, the pressuredrop along the main ink channels is half of that calculated using themaximum flow velocity

[2866] Utilizing these formulas, the pressure drops can be calculated inaccordance with the following tables: Table of Ink Channel Dimensionsand Pressure Drops Max. ink Pressure # of Nozzles flow at drop ItemsLength Width Depth supplied 5 KHz (U) Δρ Central  1 106 mm 6.4 mm 1.4 mm18,750 0.23 ml/s NA Moulding Cyan  1 100 mm 1 mm 1 mm 6,250 0.16 μl/μs111 Pa main channel (830) Magenta  2 100 mm 700 μm 700 μm 3,125 0.16μl/μs 231 Pa Main channel (826) Yellow  1 100 mm 1 mm 1 mm 6,250 0.16μl/μs 111 Pa main channel (831) Cyan 250 1.5 mm 200 μm 100 μm 25 0.16μl/μs 41.7 Pa sub- channel (833) Magenta 500 200 μm 50 μm 100 μm 12.50.031 μl/μs 44.5 Pa sub- channel (834)(a) Magenta 500 400 μm 100 μm 200μm 12.5 0.031 μl/μs 5.6 Pa sub- channel (838)(b) Yellow 250 1.5 mm 200μm 100 μm 25 0.016 μl/μs 41.7 Pa sub- channel (834) Cyan pit 250 200 μm100 μm 300 μm 25 0.010 μl/μs 3.2 Pa (842) Magenta 500 200 μm 50 μm 200μm 12.5 0.016 μl/μs 18.0 Pa through (840) Yellow 250 200 μm 100 μm 300μm 25 0.010 μl/μs 3.2 Pa pit (846) Cyan via 500 100 μm 50 μm 100 μm 12.50.031 μl/μs 22.3 Pa (843) Magenta 500 100 μm 50 μm 100 μm 12.5 0.031μl/μs 22.3 Pa via (842) Yellow 500 100 μm 50 μm 100 μm 12.5 0.031 μl/μs22.3 Pa via Magenta 500 200 μm 500 μm 100 μm 12.5 0.003 μl/μs 0.87 Pathrough hole (837) Chip  1 100 mm 730 μm 625 18,750 NA NA slot Print1500  600μ 100 μm 50 μm 12.5 0.052 μl/μs 133 Pa head through holes(881)(in the chip substrate) Print 1,000/  50 μm 60 μm 20 μm 3.125 0.049μl/μs 62.8 Pa head color channel segments (on chip front) Filter 8 per 2μm 2 μm 20 μm 0.125 0.039 μl/μs 251 Pa Slits nozzle (on entrance tonozzle chamber (882) Nozzle 1 per 70 μm 30 μm 20 μm 1 0.021 μl/μs 75.4Pa chamber nozzle (on chip front)(8 83)

[2867] The total pressure drop from the ink inlet to the nozzle istherefore approximately 701 Pa for cyan and yellow, and 845 Pa formagenta. This is less than 1% of atmospheric pressure. Of course, whenthe image printed is less than full black, the ink flow (and thereforethe pressure drop) is reduced from these values.

[2868] Making the Mould for the Ink-Head Supply Unit

[2869] The ink head supply unit 14 (FIG. 1) has features as small as 50μand a length of 106 mm. It is impractical to machine the injectionmoulding tools in the conventional manner. However, even though theoverall shape may be complex, there are no complex curves required. Theinjection moulding tools can be made using conventional milling for themain ink channels and other millimeter scale features, with alithographically fabricated inset for the fine features. A LIGA processcan be used for the inset.

[2870] A single injection moulding tool could readily have 50 or morecavities. Most of the tool complexity is in the inset.

[2871] Turning to FIG. 206, the printing system is constructed viamoulding ink supply unit 814 and lid 815 together and sealing themtogether as previously described. Subsequently print-head 44 is placedin its corresponding slot 850. Adhesive sealing strips 852, 853 areplaced over the magenta main channels so to ensure they are properlysealed. The Tape Automated Bonding (TAB) strip 810 is then connected tothe inkjet print-head 44 with the tab bonding wires running in thecavity 855. As can best be seen from FIG. 206, FIG. 207 and FIG. 212,aperture slots 855-862 are provided for the snap in insertion ofrollers. The slots provided for the “clipping in” of the rollers with asmall degree of play subsequently being provided for simple rotation ofthe rollers.

[2872] In FIG. 213 to FIG. 217, there are illustrated variousperspective views of the internal portions of a finally assembled Artcamdevice with devices appropriately numbered.

[2873]FIG. 213 illustrates a top side perspective view of the internalportions of an Artcam camera, showing the parts flattened out;

[2874]FIG. 214 illustrates a bottom side perspective view of theinternal portions of an Artcam camera, showing the parts flattened out;FIG. 215 illustrates a first

[2875] top side perspective view of the internal portions of an Artcamcamera, showing the parts as encased in an Artcam;

[2876]FIG. 216 illustrates a second top side perspective view of theinternal portions of an Artcam camera, showing the parts as encased inan Artcam;

[2877]FIG. 217 illustrates a second top side perspective view of theinternal portions of an Artcam camera, showing the parts as encased inan Artcam;

[2878] Postcard Print Rolls

[2879] Turning now to FIG. 218, in one form of the preferred embodiment,the output printer paper 11 can, on the side that is not to receive theprinted image, contain a number of pre-printed “postcard” formattedbacking portions 885. The postcard formatted sections 885 can includeprepaid postage “stamps” 886 which can comprise a printed authorizationfrom the relevant postage authority within whose jurisdiction the printroll is to be sold or utilised. By agreement with the relevantjurisdictional postal authority, the print rolls can be made availablehaving different postages. This is especially convenient where overseastravelers are in a local jurisdiction and wishing to send a number ofpostcards to their home country. Further, an address format portion 887is provided for the writing of address dispatch details in the usualform of a postcard. Finally, a message area 887 is provided for thewriting of a personalized information.

[2880] Turning now to FIG. 218 and FIG. 219, the operation of the cameradevice is such that when a series of images 890-892 is printed on afirst surface of the print roll, the corresponding backing surface isthat illustrated in FIG. 218. Hence, as each image eg. 891 is printed bythe camera, the back of the image has a ready made postcard 885 whichcan be immediately dispatched at the nearest post office box within thejurisdiction. In this way, personalized postcards can be created.

[2881] It would be evident that when utilising the postcard system asillustrated in FIG. 219 and FIG. 220 only predetermined image sizes arepossible as the synchronization between the backing postcard portion 885and the front image 891 must be maintained. This can be achieved byutilising the memory portions of the authentication chip stored withinthe print roll to store details of the length of each postcard backingformat sheet 885. This can be achieved by either having each postcardthe same size or by storing each size within the print rolls on-boardprint chip memory.

[2882] The Artcam camera control system can ensure that, when utilisinga print roll having pre-formatted postcards, that the printer roll isutilised only to print images such that each image will be on a postcardboundary. Of course, a degree of “play” can be provided by providingborder regions at the edges of each photograph which can account forslight misalignment.

[2883] Turning now to FIG. 220, it will be evident that postcard rollscan be pre-purchased by a camera user when traveling within a particularjurisdiction where they are available. The postcard roll can, on itsexternal surface, have printed information including country ofpurchase, the amount of postage on each postcard, the format of eachpostcard (for example being C, H or P or a combination of these imagemodes), the countries that it is suitable for use with and the postageexpiry date after which the postage is no longer guaranteed to besufficient can also be provided.

[2884] Hence, a user of the camera device can produce a postcard fordispatch in the mail by utilising their hand held camera to point at arelevant scene and taking a picture having the image on one surface andthe pre-paid postcard details on the other. Subsequently, the postcardcan be addressed and a short message written on the postcard before itsimmediate dispatch in the mail.

[2885] In respect of the software operation of the Artcam device,although many different software designs are possible, in one design,each Artcam device can consist of a set of loosely coupled functionalmodules utilised in a coordinated way by a single embedded applicationto serve the core purpose of the device. While the functional modulesare reused in different combinations in various classes of Artcamdevice, the application is specific to the class of Artcam device.

[2886] Most functional modules contain both software and hardwarecomponents. The software is shielded from details of the hardware by ahardware abstraction layer, while users of a module are shielded fromits software implementation by an abstract software interface. Becausethe system as a whole is driven by user-initiated and hardware-initiatedevents, most modules can run one or more asynchronous event-drivenprocesses.

[2887] The most important modules which comprise the generic Artcamdevice are shown in FIG. 221. In this and subsequent diagrams, softwarecomponents are shown on the left separated by a vertical dashed line 901from hardware components on the right. The software aspects of thesemodules are described below:

[2888] Software Modules—Artcam Application 902

[2889] The Artcam Application implements the high-level functionality ofthe Artcam device. This normally involves capturing an image, applyingan artistic effect to the image, and then printing the image. In acamera-oriented Artcam device, the image is captured via the CameraManager 903. In a printer-oriented Artcam device, the image is capturedvia the Network Manager 904, perhaps as the result of the image being“squirted” by another device.

[2890] Artistic effects are found within the unified file system managedby the File Manager 905. An artistic effect consist of a script file anda set of resources. The script is interpreted and applied to the imagevia the Image Processing Manager 906. Scripts are normally shipped onArtCards known as Artcards. By default the application uses the scriptcontained on the currently mounted Artcard.

[2891] The image is printed via the Printer Manager 908.

[2892] When the Artcam device starts up, the bootstrap process startsthe various manager processes before starting the application. Thisallows the application to immediately request services from the variousmanagers when it starts.

[2893] On initialization the application 902 registers itself as thehandler for the events listed below. When it receives an event, itperforms the action described in the table. User interface event ActionLock Focus Perform any automatic pre-capture setup via the CameraManager. This includes auto-focussing, auto-adjusting exposure, andcharging the flash. This is normally initiated by the user pressing theTake button halfway. Take Capture an image via the Camera Manager.Self-Timer Capture an image in self-timed mode via the Camera Manager.Flash Mode Update the Camera Manager to use the next flash mode. Updatethe Status Display to show the new flash mode. Print Print the currentimage via the Printer Manager. Apply an artistic effect to the image viathe Image Processing Manager if there is a current script. Update theremaining prints count on the Status Display (see Print Roll Insertedbelow). Hold Apply an artistic effect to the current image via the ImageProcessing Manager if there is a current script, but don't print theimage. Eject Eject the currently inserted ArtCards via the ArtCards FileManager. Print Roll Calculate the number of prints remaining basedInserted on the Print Manager's remaining media length and the CameraManager's aspect ratio. Update the remaining prints count on the Statusdisplay. Print Roll Update the Status Display to indicate there isRemoved no print roll present.

[2894] Where the camera includes a display, the application alsoconstructs a graphical user interface via the User Interface Manager 910which allows the user to edit the current date and time, and othereditable camera parameters. The application saves all persistentparameters in flash memory.

[2895] Real-Time Microkernel 911

[2896] The Real-Time Microkernel schedules processes preemptively on thebasis of interrupts and process priority. It provides integratedinterprocess communication and timer services, as these are closely tiedto process scheduling. All other operating system functions areimplemented outside the microkernel.

[2897] Camera Manager 903

[2898] The Camera Manager provides image capture services. It controlsthe camera hardware embedded in the Artcam. It provides an abstractcamera control interface which allows camera parameters to be queriedand set, and images captured. This abstract interface decouples theapplication from details of camera implementation. The Camera Managerutilizes the following input/output parameters and commands: outputparameters domains focus range real, real zoom range real, real aperturerange real, real shutter speed range real, real input parameters domainsfocus real zoom real aperture real shutter speed real aspect ratioclassic, HDTV, panoramic focus control mode multi-point auto,single-point auto, manual exposure control mode auto, aperture priority,shutter priority, manual flash mode auto, auto with red-eye removal,fill, off view scene mode on, off commands return value domains LockFocus none Self-Timed Capture Raw Image Capture Image Raw Image

[2899] The Camera Manager runs as an asynchronous event-driven process.It contains a set of linked state machines, one for each asynchronousoperation. These include auto focussing, charging the flash, countingdown the self-timer, and capturing the image. On initialization theCamera Manager sets the camera hardware to a known state. This includessetting a normal focal distance and retracting the zoom. The softwarestructure of the Camera Manager is illustrated in FIG. 222. The softwarecomponents are described in the following subsections:

[2900] Lock Focus 913

[2901] Lock Focus automatically adjusts focus and exposure for thecurrent scene, and enables the flash if necessary, depending on thefocus control mode, exposure control mode and flash mode. Lock Focus isnormally initiated in response to the user pressing the Take buttonhalfway. It is part of the normal image capture sequence, but may beseparated in time from the actual capture of the image, if the userholds the take button halfway depressed. This allows the user to do spotfocusing and spot metering.

[2902] Capture Image 914

[2903] Capture Image captures an image of the current scene. It lights ared-eye lamp if the flash mode includes red-eye removal, controls theshutter, triggers the flash if enabled, and senses the image through theimage sensor. It determines the orientation of the camera, and hence thecaptured image, so that the image can be properly oriented during laterimage processing. It also determines the presence of camera motionduring image capture, to trigger deblurring during later imageprocessing.

[2904] Self-Timed Capture 915

[2905] Self-Timed Capture captures an image of the current scene aftercounting down a 20 s timer. It gives the user feedback during thecountdown via the self-timer LED. During the first 15 s it can light theLED. During the last 5 s it flashes the LED.

[2906] View Scene 917

[2907] View Scene periodically senses the current scene through theimage sensor and displays it on the color LCD, giving the user anLCD-based viewfinder.

[2908] Auto Focus 918

[2909] Auto Focus changes the focal length until selected regions of theimage are sufficiently sharp to signify that they are in focus. Itassumes the regions are in focus if an image sharpness metric derivedfrom specified regions of the image sensor is above a fixed threshold.It finds the optimal focal length by performing a gradient descent onthe derivative of sharpness by focal length, changing direction andstepsize as required. If the focus control mode is multi-point auto,then three regions are used, arranged horizontally across the field ofview. If the focus control mode is single-point auto, then one region isused, in the center of the field of view. Auto Focus works within theavailable focal length range as indicated by the focus controller. Infixed-focus devices it is therefore effectively disabled.

[2910] Auto Flash 919

[2911] Auto Flash determines if scene lighting is dim enough to requirethe flash. It assumes the lighting is dim enough if the scene lightingis below a fixed threshold. The scene lighting is obtained from thelighting sensor, which derives a lighting metric from a central regionof the image sensor. If the flash is required, then it charges theflash.

[2912] Auto Exposure 920

[2913] The combination of scene lighting, aperture, and shutter speeddetermine the exposure of the captured image. The desired exposure is afixed value. If the exposure control mode is auto, Auto Exposuredetermines a combined aperture and shutter speed which yields thedesired exposure for the given scene lighting. If the exposure controlmode is aperture priority, Auto Exposure determines a shutter speedwhich yields the desired exposure for the given scene lighting andcurrent aperture. If the exposure control mode is shutter priority, AutoExposure determines an aperture which yields the desired exposure forthe given scene lighting and current shutter speed. The scene lightingis obtained from the lighting sensor, which derives a lighting metricfrom a central region of the image sensor.

[2914] Auto Exposure works within the available aperture range andshutter speed range as indicated by the aperture controller and shutterspeed controller. The shutter speed controller and shutter controllerhide the absence of a mechanical shutter in most Artcam devices.

[2915] If the flash is enabled, either manually or by Auto Flash, thenthe effective shutter speed is the duration of the flash, which istypically in the range {fraction (1/1000)} s to {fraction (1/10000)} s.

[2916] Image Processing Manager 906 (FIG. 221)

[2917] The Image Processing Manager provides image processing andartistic effects services. It utilises the VLIW Vector Processorembedded in the Artcam to perform high-speed image processing. The ImageProcessing Manager contains an interpreter for scripts written in theVark image processing language. An artistic effect therefore consists ofa Vark script file and related resources such as fonts, clip images etc.The software structure of the Image Processing Manager is illustrated inmore detail in FIG. 223 and include the following modules:

[2918] Convert and Enhance Image 921

[2919] The Image Processing Manager performs image processing in thedevice-independent CIE LAB color space, at a resolution which suits thereproduction capabilities of the Artcam printer hardware. The capturedimage is first enhanced by filtering out noise. It is optionallyprocessed to remove motion-induced blur. The image is then convertedfrom its device-dependent RGB color space to the CIE LAB color space. Itis also rotated to undo the effect of any camera rotation at the time ofimage capture, and scaled to the working image resolution. The image isfurther enhanced by scaling its dynamic range to the available dynamicrange.

[2920] Detect Faces 923

[2921] Faces are detected in the captured image based on hue and localfeature analysis. The list of detected face regions is used by the Varkscript for applying face-specific effects such as warping andpositioning speech balloons.

[2922] Vark Image Processing Language Interpreter 924

[2923] Vark consists of a general-purpose programming language with arich set of image processing extensions. It provides a range ofprimitive data types (integer, real, boolean, character), a range ofaggregate data types for constructing more complex types (array, string,record), a rich set of arithmetic and relational operators, conditionaland iterative control flow (if-then-else, while-do), and recursivefunctions and procedures. It also provides a range of image-processingdata types (image, clip image, matte, color, color lookup table,palette, dither matrix, convolution kernel, etc.), graphics data types(font, text, path), a set of image-processing functions (colortransformations, compositing, filtering, spatial transformations andwarping, illumination, text setting and rendering), and a set ofhigher-level artistic functions (tiling, painting and stroking).

[2924] A Vark program is portable in two senses. Because it isinterpreted, it is independent of the CPU and image processing enginesof its host. Because it uses a device-independent model space and adevice-independent color space, it is independent of the input colorcharacteristics and resolution of the host input device, and the outputcolor characteristics and resolution of the host output device.

[2925] The Vark Interpreter 924 parses the source statements which makeup the Vark script and produces a parse tree which represents thesemantics of the script. Nodes in the parse tree correspond tostatements, expressions, sub-expressions, variables and constants in theprogram. The root node corresponds to the main procedure statement list.

[2926] The interpreter executes the program by executing the rootstatement in the parse tree. Each node of the parse tree asks itschildren to evaluate or execute themselves appropriately. An ifstatement node, for example, has three children—a condition expressionnode, a then statement node, and an else statement node. The ifstatement asks the condition expression node to evaluate itself, anddepending on the boolean value returned asks the then statement or theelse statement to execute itself. It knows nothing about the actualcondition expression or the actual statements.

[2927] While operations on most data types are executed during executionof the parse tree, operations on image data types are deferred untilafter execution of the parse tree. This allows imaging operations to beoptimized so that only those intermediate pixels which contribute to thefinal image are computed. It also allows the final image to be computedin multiple passes by spatial subdivision, to reduce the amount ofmemory required.

[2928] During execution of the parse tree, each imaging function simplyreturns an imaging graph—a graph whose nodes are imaging operators andwhose leaves are images—constructed with its corresponding imagingoperator as the root and its image parameters as the root's children.The image parameters are of course themselves image graphs. Thus eachsuccessive imaging function returns a deeper imaging graph.

[2929] After execution of the parse tree, an imaging graph is obtainedwhich corresponds to the final image. This imaging graph is thenexecuted in a depth-first manner (like any expression tree), with thefollowing two optimizations: (1) only those pixels which contribute tothe final image are computed at a given node, and (2) the children of anode are executed in the order which minimizes the amount of memoryrequired. The imaging operators in the imaging graph are executed in theoptimized order to produce the final image. Compute-intensive imagingoperators are accelerated using the VLIW Processor embedded in theArtcam device. If the amount of memory required to execute the imaginggraph exceeds available memory, then the final image region issubdivided until the required memory no longer exceeds available memory.

[2930] For a well-constructed Vark program the first optimization isunlikely to provide much benefit per se. However, if the final imageregion is subdivided, then the optimization is likely to provideconsiderable benefit. It is precisely this optimization, then, thatallows subdivision to be used as an effective technique for reducingmemory requirements. One of the consequences of deferred execution ofimaging operations is that program control flow cannot depend on imagecontent, since image content is not known during parse tree execution.In practice this is not a severe restriction, but nonetheless must beborne in mind during language design.

[2931] The notion of deferred execution (or lazy evaluation) of imagingoperations is described by Guibas and Stolfi (Guibas, L. J., and J.Stolfi, “A Language for Bitmap Manipulation”, ACM Transactions onGraphics, Vol. 1, No. 3, July 1982, pp. 191-214). They likewiseconstruct an imaging graph during the execution of a program, and duringsubsequent graph evaluation propagate the result region backwards toavoid computing pixels which do not contribute to the final image.Shantzis additionally propagates regions of available pixels forwardsduring imaging graph evaluation (Shantzis, M. A., “A Model for Efficientand Flexible Image Computing”, Computer Graphics Proceedings, AnnualConference Series, 1994, pp. 147-154). The Vark Interpreter uses themore sophisticated multi-pass bi-directional region propagation schemedescribed by Cameron (Cameron, S., “Efficient Bounds in ConstructiveSolid Geometry”, IEEE Computer Graphics & Applications, Vol. 11, No. 3,May 1991, pp. 68-74). The optimization of execution order to minimisememory usage is due to Shantzis, but is based on standard compilertheory (Aho, A. V., R. Sethi, and J. D. Ullman, “Generating Code fromDAGs”, in Compilers: Principles, Techniques, and Tools, Addison-Wesley,1986, pp. 557-567,). The Vark Interpreter uses a more sophisticatedscheme than Shantzis, however, to support variable-sized image buffers.The subdivision of the result region in conjunction with regionpropagation to reduce memory usage is also due to Shantzis.

[2932] Printer Manager 908 (FIG. 221)

[2933] The Printer Manager provides image printing services. It controlsthe Ink Jet printer hardware embedded in the Artcam. It provides anabstract printer control interface which allows printer parameters to bequeried and set, and images printed. This abstract interface decouplesthe application from details of printer implementation and includes thefollowing variables: output parameters domains media is present boolmedia has fixed page bool size media width real remaining media lengthreal fixed page size real, real input parameters domains page size real,real commands return value domains Print Image none output eventsinvalid media media exhausted media inserted media removed

[2934] The Printer Manager runs as an asynchronous event-driven process.It contains a set of linked state machines, one for each asynchronousoperation. These include printing the image and auto mounting the printroll. The software structure of the Printer Manager is illustrated inFIG. 224. The software components are described in the followingdescription:

[2935] Print Image 930

[2936] Print Image prints the supplied image. It uses the VLIW Processorto prepare the image for printing. This includes converting the imagecolor space to device-specific CMY and producing half-toned bi-leveldata in the format expected by the print head.

[2937] Between prints, the paper is retracted to the lip of the printroll to allow print roll removal, and the nozzles can be capped toprevent ink leakage and drying. Before actual printing starts,therefore, the nozzles are uncapped and cleared, and the paper isadvanced to the print head. Printing itself consists of transferringline data from the VLIW processor, printing the line data, and advancingthe paper, until the image is completely printed. After printing iscomplete, the paper is cut with the guillotine and retracted to theprint roll, and the nozzles are capped. The remaining media length isthen updated in the print roll.

[2938] Auto Mount Print Roll 131

[2939] Auto Mount Print Roll responds to the insertion and removal ofthe print roll. It generates print roll insertion and removal eventswhich are handled by the application and used to update the statusdisplay. The print roll is authenticated according to a protocol betweenthe authentication chip embedded in the print roll and theauthentication chip embedded in Artcam. If the print roll failsauthentication then it is rejected. Various information is extractedfrom the print roll. Paper and ink characteristics are used during theprinting process. The remaining media length and the fixed page size ofthe media, if any, are published by the Print Manager and are used bythe application.

[2940] User Interface Manager 910 (FIG. 221)

[2941] The User Interface Manager is illustrated in more detail if FIG.225 and provides user interface management services. It consists of aPhysical User Interface Manager 911, which controls status display andinput hardware, and a Graphical User Interface Manager 912, whichmanages a virtual graphical user interface on the color display. TheUser Interface Manager translates virtual and physical inputs intoevents. Each event is placed in the event queue of the processregistered for that event.

[2942] File Manager 905 (FIG. 222)

[2943] The File Manager provides file management services. It provides aunified hierarchical file system within which the file systems of allmounted volumes appear. The primary removable storage medium used in theArtcam is the ArtCards. A ArtCards is printed at high resolution withblocks of bi-level dots which directly representserror- tolerantReed-Solomon-encoded binary data. The block structure supports appendand append-rewrite in suitable read-write ArtCards devices (notinitially used in Artcam). At a higher level a ArtCards can contain anextended append-rewriteable ISO9660 CD-ROM file system. The softwarestructure of the File Manager, and the ArtCards Device Controller inparticular, can be as illustrated in FIG. 226.

[2944] Network Manager 904 (FIG. 222)

[2945] The Network Manager provides “appliance” networking servicesacross various interfaces including infra-red (IrDA) and universalserial bus (USB). This allows the Artcam to share captured images, andreceive images for printing.

[2946] Clock Manager 907 (FIG. 222)

[2947] The Clock Manager provides date and time-of-day clock services.It utilises the battery-backed real-time clock embedded in the Artcam,and controls it to the extent that it automatically adjusts for clockdrift, based on auto-calibration carried out when the user sets thetime.

[2948] Power Management

[2949] When the system is idle it enters a quiescent power state duringwhich only periodic scanning for input events occurs. Input eventsinclude the press of a button or the insertion of a ArtCards. As soon asan input event is detected the Artcam device re-enters an active powerstate. The system then handles the input event in the usual way.

[2950] Even when the system is in an active power state, the hardwareassociated with individual modules is typically in a quiescent powerstate. This reduces overall power consumption, and allows particularlydraining hardware components such as the printer's paper cuttingguillotine to monopolise the power source when they are operating. Acamera-oriented Artcam device is, by default, in image capture mode.This means that the camera is active, and other modules, such as theprinter, are quiescent. This means that when non-camera functions areinitiated, the application must explicitly suspend the camera module.Other modules naturally suspend themselves when they become idle.

[2951] Watchdog Timer

[2952] The system generates a periodic high-priority watchdog timerinterrupt. The interrupt handler resets the system if it concludes thatthe system has not progressed since the last interrupt, i.e. that it hascrashed.

[2953] Alternative Print Roll

[2954] In an alternative embodiment, there is provided a modified formof print roll which can be constructed mostly from injection mouldedplastic pieces suitably snapped fitted together. The modified form ofprint roll has a high ink storage capacity in addition to a somewhatsimplified construction. The print media onto which the image is to beprinted is wrapped around a plastic sleeve former for simplifiedconstruction. The ink media reservoir has a series of air vents whichare constructed so as to minimise the opportunities for the ink flow outof the air vents. Further, a rubber seal is provided for the ink outletholes with the rubber seal being pierced on insertion of the print rollinto a camera system. Further, the print roll includes a print mediaejection slot and the ejection slot includes a surrounding mouldedsurface which provides and assists in the accurate positioning of theprint media ejection slot relative to the printhead within the printingor camera system.

[2955] Turning to FIG. 227 to FIG. 231, in FIG. 227 there is illustrateda single point roll unit 1001 in an assembled form with a partialcutaway showing internal portions of the printroll. FIG. 228 and FIG.229 illustrate left and right side exploded perspective viewsrespectively. FIG. 230 and FIG. 231 are exploded perspective's of theinternal core portion 1007 of FIG. 227 to FIG. 229.

[2956] The print roll 1001 is constructed around the internal coreportion 1007 which contains an internal ink supply. Outside of the coreportion 1007 is provided a former 1008 around which is wrapped a paperor film supply 1009. Around the paper supply it is constructed two coverpieces 1010, 1011 which snap together around the print roll so as toform a covering unit as illustrated in FIG. 227. The bottom cover piece1011 includes a slot 1012 through which the output of the print media1004 for interconnection with the camera system.

[2957] Two pinch rollers 1038, 1039 are provided to pinch the paperagainst a drive pinch roller 1040 so they together provide for adecurling of the paper around the roller 1040. The decurling acts tonegate the strong curl that may be imparted to the paper from beingstored in the form of print roll for an extended period of time. Therollers 1038, 1039 are provided to form a snap fit with end portions ofthe cover base portion 1077 and the roller 1040 which includes a coggedend 1043 for driving, snap fits into the upper cover piece 1010 so as topinch the paper 1004 firmly between.

[2958] The cover pieces 1011 includes an end protuberance or lip 1042.The end lip 1042 is provided for accurately alignment of the exit holeof the paper with a corresponding printing heat platen structure withinthe camera system. In this way, accurate alignment or positioning of theexiting paper relative to an adjacent printhead is provided for fullguidance of the paper to the printhead.

[2959] Turning now to FIG. 230 and FIG. 231, there is illustratedexploded perspectives of the internal core portion which can be formedfrom an injection moulded part and is based around 3 core ink cylindershaving internal sponge portions 1034-1036.

[2960] At one end of the core portion there is provided a series of airbreathing channels eg. 1014-1016. Each air breathing channel 1014-1016interconnects a first hole eg. 1018 with an external contact point 1019which is interconnected to the ambient atmosphere. The path followed bythe air breathing channel eg. 1014 is preferably of a winding nature,winding back and forth. The air breathing channel is sealed by a portionof sealing tape 1020 which is placed over the end of the core portion.The surface of the sealing tape 1020 is preferably hydrophobicallytreated to make it highly hydrophobic and to therefore resist the entryof any fluid portions into the air breathing channels.

[2961] At a second end of the core portion 1007 there is provided arubber sealing cap 1023 which includes three thickened portions 1024,1025 and 1026 with each thickened portion having a series of thinnedholes. For example, the portion 1024 has thinned holes 1029, 1030 and1031. The thinned holes are arranged such that one hole from each of theseparate thickened portions is arranged in a single line. For example,the thinned holes 1031, 1032 and 1033 (FIG. 230) are all arranged in asingle line with each hole coming from a different thinned portion. Eachof the thickened portions corresponds to a corresponding ink supplyreservoir such that when the three holes are pierced, fluidcommunication is made with a corresponding reservoir.

[2962] An end cap unit 1044 is provided for attachment to the coreportion 1007. The end cap 1044 includes an aperture 1046 for theinsertion of an authentication chip 1033 in addition to a prongedadaptor (not shown) which includes three prongs which are insertedthrough corresponding holes (e.g., 1048), piercing a thinned portion(e.g., 1033) of seal 1023 and interconnecting to a corresponding inkchamber (e.g., 1035).

[2963] Also inserted in the end portion 1044 is an authentication chip1033, the authentication chip being provided to authenticate access ofthe print roll to the camera system. This core portion is thereforedivided into three separate chambers with each containing a separatecolor of ink and internal sponge. Each chamber includes an ink outlet ina first end and an air breathing hole in the second end. A cover of thesealing tape 1020 is provided for covering the air breathing channelsand the rubber seal 1023 is provided for sealing the second end of theink chamber.

[2964] The internal ink chamber sponges and the hydrophobic channelallow the print roll to be utilized in a mobile environment and withmany different orientations. Further, the sponge can itself behydrophobically treated so as to force the ink out of the core portionin an orderly manner.

[2965] A series of ribs (e.g., 1027) can be provided on the surface ofthe core portion so as to allow for minimal frictional contact betweenthe core portion 1007 and the printroll former 1008.

[2966] Most of the portions of the print roll can be constructed fromejection moulded plastic and the print roll includes a high internal inkstorage capacity. The simplified construction also includes a paperdecurling mechanism in addition to ink chamber air vents which providefor minimal leaking. The rubber seal provides for effectivecommunication with an ink supply chambers so as to provide for highoperational capabilities.

[2967] Artcards can, of course, be used in many other environments. Forexample ArtCards can be used in both embedded and personal computer (PC)applications, providing a user-friendly interface to large amounts ofdata or configuration information.

[2968] This leads to a large number of possible applications. Forexample, a ArtCards reader can be attached to a PC. The applications forPCs are many and varied. The simplest application is as a low costread-only distribution medium. Since ArtCards are printed, they providean audit trail if used for data distribution within a company.

[2969] Further, many times a PC is used as the basis for a closedsystem, yet a number of configuration options may exist. Rather thanrely on a complex operating system interface for users, the simpleinsertion of a ArtCards into the ArtCards reader can provide all theconfiguration requirements. While the back side of a ArtCards has thesame visual appearance regardless of the application (since it storesthe data), the front of a ArtCards is application dependent. It mustmake sense to the user in the context of the application.

[2970] It can therefore be seen that the arrangement of FIG. Z35provides for an efficient distribution of information in the forms ofbooks, newspapers, magazines, technical manuals, etc.

[2971] In a further application, as illustrated in FIG. Z36, the frontside of a ArtCards 80 can show an image that includes an artistic effectto be applied to a sampled image. A camera system 81 can be providedwhich includes a cardreader 82 for reading the programmed data on theback of the card 80 and applying the algorithmic data to a sampled image83 so as to produce an output image 84. The camera unit 81 including anon board inkjet printer and sufficient processing means for processingthe sampled image data. A further application of the ArtCards concept,hereinafter called “BizCard” is to store company information on businesscards. BizCard is a new concept in company information. The front sideof a bizCard as illustrated in FIG. Z37 and looks and functions exactlyas today's normal business card. It includes a photograph and contactinformation, with as many varied card styles as there are businesscards. However, the back of each bizCard contains a printed array ofblack and white dots that holds 1-2 megabytes of data about the company.The result is similar to having the storage of a 3.5″ disk attached toeach business card.

[2972] The information could be company information, specific productsheets, web-site pointers, e-mail addresses, a resume . . . in short,whatever the bizCard holder wants it to. BizCards can be read by anyArtCards reader such as an attached PC card reader, which can beconnected to a standard PC by a USB port. BizCards can also be displayedas documents on specific embedded devices. In the case of a PC, a usersimply inserts the bizCard into their reader. The bizCard is thenpreferably navigated just like a web-site using a regular web browser.

[2973] Simply by containing the owner's photograph and digital signatureas well as a pointer to the company's public key, each bizCard can beused to electronically verify that the person is in fact who they claimto be and does actually work for the specified company. In addition bypointing to the company's public key, a bizCard permits simpleinitiation of secure communications.

[2974] A further application, hereinafter known as “TourCard” is anapplication of the ArtCards which contains information for tourists andvisitors to a city. When a tourCard is inserted into the ArtCards bookreader, information can be in the form of:

[2975] Maps

[2976] Public Transport Timetables

[2977] Places of Interest

[2978] Local history

[2979] Events and Exhibitions

[2980] Restaurant locations

[2981] Shopping Centres

[2982] TourCard is a low cost alternative to tourist brochures, guidebooks and street directories. With a manufacturing cost of just one centper card, tourCards could be distributed at tourist information centres,hotels and tourist attractions, at a minimum cost, or free if sponsoredby advertising. The portability of the bookreader makes it the perfectsolution for tourists. TourCards can also be used at informationkiosk's, where a computer equipped with the ArtCards reader can decodethe information encoded into the tourCard on any web browser.

[2983] It is interactivity of the bookreader that makes the tourCard soversatile. For example, Hypertext links contained on the map can beselected to show historical narratives of the feature buildings. In thisway the tourist can embark on a guided tour of the city, with relevanttransportation routes and timetables available at any time. The tourCardeliminates the need for separate maps, guide books, timetables andrestaurant guides and creates a simple solution for the independenttraveller. Of course, many other utilizations of the data cards arepossible. For example, newspapers, study guides, pop group cards,baseball cards, timetables, music data files, product parts,advertising, TV guides, movie guides, trade show information, tear offcards in magazines, recipes, classified ads, medical information,programmes and software, horse racing form guides, electronic forms,annual reports, restaurant, hotel and vacation guides, translationprogrammes, golf course information, news broadcast, comics, weatherdetails etc.

[2984] For example, the ArtCards could include a book's contents or anewspaper's contents. An example of such a system is as illustrated inFIG. Z35 wherein the ArtCards 70 includes a book title on one surfacewith the second surface having the encoded contents of the book printedthereon. The card 70 is inserted in the reader 72 which can include aflexible display 73 which allows for the folding up of card reader 72.The card reader 72 can include display controls 74 which allow forpaging forward and back and other controls of the card reader 72.

[2985] Ink Jet Technologies

[2986] The embodiments of the invention use an ink jet printer typedevice. Of course many different devices could be used. Howeverpresently popular ink jet printing technologies are unlikely to besuitable.

[2987] The most significant problem with thermal inkjet is powerconsumption. This is approximately 100 times that required for highspeed, and stems from the energy-inefficient means of drop ejection.This involves the rapid boiling of water to produce a vapor bubble whichexpels the ink. Water has a very high heat capacity, and must besuperheated in thermal inkjet applications. This leads to an efficiencyof around 0.02%, from electricity input to drop momentum (and increasedsurface area) out.

[2988] The most significant problem with piezoelectric inkjet is sizeand cost. Piezoelectric crystals have a very small deflection atreasonable drive voltages, and therefore require a large area for eachnozzle. Also, each piezoelectric actuator must be connected to its drivecircuit on a separate substrate. This is not a significant problem atthe current limit of around 300 nozzles per print head, but is a majorimpediment to the fabrication of pagewidth print heads with 19,200nozzles.

[2989] Ideally, the inkjet technologies used meet the stringentrequirements of in-camera digital color printing and other high quality,high speed, low cost printing applications. To meet the requirements ofdigital photography, new inkjet technologies have been created. Thetarget features include:

[2990] low power (less than 10 Watts)

[2991] high resolution capability (1,600 dpi or more)

[2992] photographic quality output

[2993] low manufacturing cost

[2994] small size (pagewidth times minimum cross section)

[2995] high speed (<2 seconds per page).

[2996] All of these features can be met or exceeded by the inkjetsystems described below with differing levels of difficulty. Forty-fivedifferent inkjet technologies have been developed by the Assignee togive a wide range of choices for high volume manufacture. Thesetechnologies form part of separate applications assigned to the presentAssignee as set out in the table below.

[2997] The inkjet designs shown here are suitable for a wide range ofdigital printing systems, from battery powered one-time use digitalcameras, through to desktop and network printers, and through tocommercial printing systems

[2998] For ease of manufacture using standard process equipment, theprint head is designed to be a monolithic 0.5 micron CMOS chip with MEMSpost processing. For color photographic applications, the print head is100 mm long, with a width which depends upon the inkjet type. Thesmallest print head designed is IJ38, which is 0.35 mm wide, giving achip area of 35 square mm. The print heads each contain 19,200 nozzlesplus data and control circuitry.

[2999] Ink is supplied to the back of the print head by injection moldedplastic ink channels. The molding requires 50 micron features, which canbe created using a lithographically micromachined insert in a standardinjection molding tool. Ink flows through holes etched through the waferto the nozzle chambers fabricated on the front surface of the wafer. Theprint head is connected to the camera circuitry by tape automatedbonding.

CROSS-REFERENCED APPLICATIONS

[3000] The following table is a guide to cross-referenced patentapplications filed concurrently herewith and discussed hereinafter withthe reference being utilized in subsequent tables when referring to aparticular case: Docket No. Reference Title IJ01US IJ01 Radiant PlungerInk Jet Printer IJ02US IJ02 Electrostatic Ink Jet Printer IJ03US IJ03Planar Thermoelastic Bend Actuator Ink Jet IJ04US IJ04 StackedElectrostatic Ink Jet Printer IJ05US IJ05 Reverse Spring Lever Ink JetPrinter IJ06US IJ06 Paddle Type Ink Jet Printer IJ07US IJ07 PermanentMagnet Electromagnetic Ink Jet Printer IJ08US IJ08 Planar Swing GrillElectromagnetic Ink Jet Printer IJ09US IJ09 Pump Action Refill Ink JetPrinter IJ10US IJ10 Pulsed Magnetic Field Ink Jet Printer IJ11US IJ11Two Plate Reverse Firing Electromagnetic Ink Jet Printer IJ12US IJ12Linear Stepper Actuator Ink Jet Printer IJ13US IJ13 Gear Driven ShutterInk Jet Printer IJ14US IJ14 Tapered Magnetic Pole Electromagnetic InkJet Printer IJ15US IJ15 Linear Spring Electromagnetic Grill Ink JetPrinter IJ16US IJ16 Lorenz Diaphragm Electromagnetic Ink Jet PrinterIJ17US IJ17 PTFE Surface Shooting Shuttered Oscillating Pressure Ink JetPrinter IJ18US IJ18 Buckle Grip Oscillating Pressure Ink Jet PrinterIJ19US IJ19 Shutter Based Ink Jet Printer IJ20US IJ20 Curling CalyxThermoelastic Ink Jet Printer IJ21US IJ21 Thermal Actuated Ink JetPrinter IJ22US IJ22 Iris Motion Ink Jet Printer IJ23US IJ23 DirectFiring Thermal Bend Actuator Ink Jet Printer IJ24US IJ24 Conductive PTFEBen Activator Vented Ink Jet Printer IJ25US IJ25 Magnetostrictive InkJet Printer IJ26US IJ26 Shape Memory Alloy Ink Jet Printer IJ27US IJ27Buckle Plate Ink Jet Printer IJ28US IJ28 Thermal Elastic Rotary ImpellerInk Jet Printer IJ29US IJ29 Thermoelastic Bend Actuator Ink Jet PrinterIJ30US IJ30 Thermoelastic Bend Actuator Using PTFE and Corrugated CopperInk Jet Printer IJ31US IJ31 Bend Actuator Direct Ink Supply Ink JetPrinter IJ32US IJ32 A High Young's Modulus Thermoelastic Ink Jet PrinterIJ33US IJ33 Thermally actuated slotted chamber wall ink jet printerIJ34US IJ34 Ink Jet Printer having a thermal actuator comprising anexternal coiled spring IJ35US IJ35 Trough Container Ink Jet PrinterIJ36US IJ36 Dual Chamber Single Vertical Actuator Ink Jet IJ37US IJ37Dual Nozzle Single Horizontal Fulcrum Actuator Ink Jet IJ38US IJ38 DualNozzle Single Horizontal Actuator Ink Jet IJ39US IJ39 A single bendactuator cupped paddle ink jet printing device IJ40US IJ40 A thermallyactuated ink jet printer having a series of thermal actuator unitsIJ41US IJ41 A thermally actuated ink jet printer including a taperedheater element IJ42US IJ42 Radial Back-Curling Thermoelastic Ink JetIJ43US IJ43 Inverted Radial Back-Curling Thermoelastic Ink Jet IJ44USIJ44 Surface bend actuator vented ink supply ink jet printer IJ45US IJ45Coil Acutuated Magnetic Plate Ink Jet Printer

[3001] Tables of Drop-on-Demand Inkjets

[3002] Eleven important characteristics of the fundamental operation ofindividual inkjet nozzles have been identified. These characteristicsare largely orthogonal, and so can be elucidated as an elevendimensional matrix. Most of the eleven axes of this matrix includeentries developed by the present assignee.

[3003] The following tables form the axes of an eleven dimensional tableof inkjet types.

[3004] Actuator mechanism (18 types)

[3005] Basic operation mode (7 types)

[3006] Auxiliary mechanism (8 types)

[3007] Actuator amplification or modification method (17 types)

[3008] Actuator motion (19 types)

[3009] Nozzle refill method (4 types)

[3010] Method of restricting back-flow through inlet (10 types)

[3011] Nozzle clearing method (9 types)

[3012] Nozzle plate construction (9 types)

[3013] Drop ejection direction (5 types)

[3014] Ink type (7 types)

[3015] The complete eleven dimensional table represented by these axescontains 36.9 billion possible configurations of inkjet nozzle. Whilenot all of the possible combinations result in a viable inkjettechnology, many million configurations are viable. It is clearlyimpractical to elucidate all of the possible configurations. Instead,certain inkjet types have been investigated in detail. These aredesignated IJ01 to IJ45 above.

[3016] Other inkjet configurations can readily be derived from theseforty-five examples by substituting alternative configurations along oneor more of the 11 axes. Most of the IJ01 to IJ45 examples can be madeinto inkjet print heads with characteristics superior to any currentlyavailable inkjet technology.

[3017] Where there are prior art examples known to the inventor, one ormore of these examples are listed in the examples column of the tablesbelow. The IJ01 to IJ45 series are also listed in the examples column.In some cases, a printer may be listed more than once in a table, whereit shares characteristics with more than one entry.

[3018] Suitable applications include: Home printers, Office networkprinters, Short run digital printers, Commercial print systems, Fabricprinters, Pocket printers, Internet WWW printers, Video printers,Medical imaging, Wide format printers, Notebook PC printers, Faxmachines, Industrial printing systems, Photocopiers, Photographicminilabs etc.

[3019] The information associated with the aforementioned 11 dimensionalmatrix are set out in the following tables. Actuator MechanismDescription Advantages Disadvantages Examples Actuator mechanism(applied only to selected ink drops) Thermal An electrothermal Largeforce High power Canon Bubblejet bubble heater heats the ink togenerated Ink carrier 1979 Endo et al GB above boiling point, Simplelimited to water patent 2,007,162 transferring significant constructionLow efficiency Xerox heater-in- heat to the aqueous No moving parts Highpit 1990 Hawkins et ink. A bubble Fast operation temperatures al U.S.Pat. No. nucleates and quickly Small chip area required 4,899,181 forms,expelling the required for actuator High mechanical Hewlett-Packard ink.stress TIJ 1982 Vaught et The efficiency of the Unusual al U.S. Pat. No.process is low, with materials required 4,490,728 typically less thanLarge drive 0.05% of the electrical transistors energy being Cavitationcauses transformed into actuator failure kinetic energy of the Kogationreduces drop. bubble formation Large print heads are difficult tofabricate Piezo- A piezoelectric crystal Low power Very large area Kyseret al electric such as lead consumption required for actuator U.S. Pat.No. 3,946,398 lanthanum zirconate Many ink types Difficult to ZoltanU.S. Pat. (PZT) is electrically can be used integrate with No. 3,683,212activated, and either Fast operation electronics 1973 Stemme expands,shears, or High efficiency High voltage U.S. Pat. No. 3,747,120 bends toapply drive transistors Epson Stylus pressure to the ink, requiredTektronix ejecting drops. Full pagewidth IJ04 print heads impracticaldue to actuator size Requires electrical poling in high field strengthsduring manufacture Electro- An electric field is Low power Low maximumSeiko Epson, strictive used to activate consumption strain (approx. Usuiet all JP electrostriction in Many ink types 0.01%) 253401/96 relaxormaterials such can be used Large area IJ04 as lead lanthanum Low thermalrequired for actuator zirconate titanate expansion due to low strain(PLZT) or lead Electric field Response speed magnesium niobate strengthrequired is marginal (˜10 (PMN). (approx. 3.5 V/μm) μs) can be generatedHigh voltage without difficulty drive transistors Does not requirerequired electrical poling Full pagewidth print heads impractical due toactuator size Ferro- An electric field is Low power Difficult to IJ04electric used to induce a phase consumption integrate with transitionbetween the Many ink types electronics antiferroelectric (AFE) can beused Unusual and ferroelectric (FE) Fast operation materials such asphase. Perovskite (<1 μs) PLZSnT are materials such as tin Relativelyhigh required modified lead longitudinal strain Actuators requirelanthanum zirconate High efficiency a large area titanate (PLZSnT)Electric field exhibit large strains of strength of around 3 up to 1%associated V/μm can be readily with the AFE to FE provided phasetransition. Electro- Conductive plates are Low power Difficult to IJ02,IJ04 static plates separated by a consumption operate electrostaticcompressible or fluid Many ink types devices in an dielectric (usuallyair). can be used aqueous Upon application of a Fast operationenvironment voltage, the plates The electrostatic attract each other andactuator will displace ink, causing normally need to be drop ejection.The separated from the conductive plates may ink be in a comb or Verylarge area honeycomb structure, required to achieve or stacked toincrease high forces the surface area and High voltage therefore theforce. drive transistors may be required Full pagewidth print heads arenot competitive due to actuator size Electro- A strong electric fieldLow current High voltage 1989 Saito et al, static pull is applied to theink, consumption required U.S. Pat. No. 4,799,068 on ink whereupon Lowtemperature May be damaged 1989 Miura et al, electrostatic attraction bysparks due to air U.S. Pat. No. 4,810,954 accelerates the ink breakdownTone-jet towards the print Required field medium. strength increases asthe drop size decreases High voltage drive transistors requiredElectrostatic field attracts dust Permanent An electromagnet Low powerComplex IJ07, IJ10 magnet directly attracts a consumption fabricationelectro- permanent magnet, Many ink types Permanent magnetic displacingink and can be used magnetic material causing drop ejection. Fastoperation such as Neodymium Rare earth magnets High efficiency IronBoron (NdFeB) with a field strength Easy extension required. around 1Tesla can be from single nozzles High local used. Examples are: topagewidth print currents required Samarium Cobalt heads Copper (SaCo)and magnetic metalization should materials in the be used for longneodymium iron boron electromigration family (NdFeB, lifetime and lowNdDyFeBNb, resistivity NdDyFeB, etc) Pigmented inks are usuallyinfeasible Operating temperature limited to the Curie temperature(around 540 K) Soft A solenoid induced a Low power Complex IJ01, IJ05,IJ08, magnetic magnetic field in a soft consumption fabrication IJ10,IJ12, IJ14, core electro- magnetic core or yoke Many ink types Materialsnot IJ15, IJ17 magnetic fabricated from a can be used usually present ina ferrous material such Fast operation CMOS fab such as as electroplatediron High efficiency NiFe, CoNiFe, or alloys such as CoNiFe Easyextension CoFe are required [1], CoFe, or NiFe from single nozzles Highlocal alloys. Typically, the to pagewidth print currents required softmagnetic material heads Copper is in two parts, which ♦ metalizationshould are normally held be used for long apart by a spring.electromigration When the solenoid is lifetime and low actuated, the twoparts resistivity attract, displacing the Electroplating is ink.required High saturation flux density is required (2.0-2.1 T isachievable with CoNiFe [1]) Magnetic The Lorenz force Low power Forceacts as a IJ06, IJ11, IJ13, Lorenz acting on a current consumptiontwisting motion IJ16 force carrying wire in a Many ink types Typically,only a magnetic field is can be used quarter of the utilized. Fastoperation solenoid length This allows the High efficiency provides forcein a magnetic field to be Easy extension useful direction suppliedexternally to from single nozzles High local the print head, for topagewidth print currents required example with rare heads Copper earthpermanent metalization should magnets. be used for long Only the currentelectromigration carrying wire need be lifetime and low fabricated onthe print- resistivity head, simplifying Pigmented inks materials areusually requirements. infeasible Magneto- The actuator uses the Many inktypes Force acts as a Fischenbeck, striction giant magnetostrictive canbe used twisting motion U.S. Pat. No. 4,032,929 effect of materials Fastoperation Unusual IJ25 such as Terfenol-D (an Easy extension materialssuch as alloy of terbium, from single nozzles Terfenol-D are dysprosiumand iron to pagewidth print required developed at the Naval heads Highlocal Ordnance Laboratory, High force is currents required henceTer-Fe-NOL). available Copper For best efficiency, the metalizationshould actuator should be pre- be used for long stressed to approx. 8electromigration MPa. lifetime and low resistivity Pre-stressing may berequired Surface Ink under positive Low power Requires Silverbrook, EPtension pressure is held in a consumption supplementary force 0771 658A2 and reduction nozzle by surface Simple to effect drop related patenttension. The surface construction separation applications tension of theink is No unusual Requires special reduced below the materials requiredin ink surfactants bubble threshold, fabrication Speed may be causingthe ink to High efficiency limited by surfactant egress from the Easyextension properties nozzle. from single nozzles to pagewidth printheads Viscosity The ink viscosity is Simple Requires Silverbrook, EPreduction locally reduced to construction supplementary force 0771 658A2 and select which drops are No unusual to effect drop related patentto be ejected. A materials required in separation applications viscosityreduction can fabrication Requires special be achieved Easy extensionink viscosity electrothermally with from single nozzles properties mostinks, but special to pagewidth print High speed is inks can beengineered heads difficult to achieve for a 100:1 viscosity Requiresreduction. oscillating ink pressure A high temperature difference(typically 80 degrees) is required Acoustic An acoustic wave is Canoperate Complex drive 1993 Hadimioglu generated and without a nozzlecircuitry et al, EUP 550,192 focussed upon the plate Complex 1993 Elrodet al, drop ejection region. fabrication EUP 572,220 Low efficiency Poorcontrol of drop position Poor control of drop volume Thermo- An actuatorwhich Low power Efficient aqueous IJ03, IJ09, IJ17, elastic bend reliesupon differential consumption operation requires a IJ18, IJ19, IJ20,actuator thermal expansion Many ink types thermal insulator on IJ21,IJ22, IJ23, upon Joule heating is can be used the hot side IJ24, IJ27,IJ28, used. Simple planar Corrosion IJ29, IJ30, IJ31, fabricationprevention can be IJ32, IJ33, IJ34, Small chip area difficult IJ35,IJ36, IJ37, required for each Pigmented inks IJ38 ,IJ39, IJ40, actuatormay be infeasible, IJ41 Fast operation as pigment particles Highefficiency may jam the bend CMOS actuator compatible voltages andcurrents Standard MEMS processes can be used Easy extension from singlenozzles to pagewidth print heads High CTE A material with a very Highforce can Requires special IJ09, IJ17, IJ18, thermo- high coefficient ofbe generated material (e.g. PTFE) IJ20, IJ21, IJ22, elastic thermalexpansion PTFE is a Requires a PTFE IJ23, IJ24, IJ27, actuator (CTE)such as candidate for low deposition process, IJ28, IJ29, IJ30,polytetrafluoroethylene dielectric constant which is not yet IJ31, IJ42,IJ43, (PTFE) is used. As insulation in ULSI standard in ULSI IJ44 highCTE materials Very low power fabs are usually non- consumption PTFEdeposition conductive, a heater Many ink types cannot be followedfabricated from a can be used with high conductive material is Simpleplanar temperature (above incorporated. A 50 μm fabrication 350° C.)processing long PTFE bend Small chip area Pigmented inks actuator withrequired for each may be infeasible, polysilicon heater and actuator aspigment particles 15 mW power input Fast operation may jam the bend canprovide 180 μN High efficiency actuator force and 10 μm CMOS deflection.Actuator compatible voltages motions include: and currents Bend Easyextension Push from single nozzles Buckle to pagewidth print Rotateheads Conductive A polymer with a high High force can Requires specialIJ24 polymer coefficient of thermal be generated materials thermo-expansion (such as Very low power development (High elastic PTFE) isdoped with consumption CTE conductive actuator conducting substancesMany ink types polymer) to increase its can be used Requires a PTFEconductivity to about 3 Simple planar deposition process, orders ofmagnitude fabrication which is not yet below that of copper. Small chiparea standard in ULSI The conducting required for each fabs polymerexpands actuator PTFE deposition when resistively Fast operation cannotbe followed heated. High efficiency with high Examples of CMOStemperature (above conducting dopants compatible voltages 350° C.)processing include: and currents Evaporation and Carbon nanotubes Easyextension CVD deposition Metal fibers from single nozzles techniquescannot Conductive polymers to pagewidth print be used such as dopedheads Pigmented inks polythiophene may be infeasible, Carbon granules aspigment particles may jam the bend actuator Shape A shape memory alloyHigh force is Fatigue limits IJ26 memory such as TiNi (also available(stresses maximum number alloy known as Nitinol - of hundreds of MPa) ofcycles Nickel Titanium alloy Large strain is Low strain (1%) developedat the Naval available (more than is required to extend OrdnanceLaboratory) 3%) fatigue resistance is thermally switched High corrosionCycle rate between its weak resistance limited by heat martensitic stateand Simple removal its high stiffness construction Requires unusualaustenic state. The Easy extension materials (TiNi) shape of theactuator from single nozzles The latent heat of in its martensitic stateto pagewidth print transformation must is deformed relative to heads beprovided the austenic shape. Low voltage High current The shape changeoperation operation causes ejection of a Requires pre- drop. stressingto distort the martensitic state Linear Linear magnetic Linear MagneticRequires unusual IJ12 Magnetic actuators include the actuators can besemiconductor Actuator Linear Induction constructed with materials suchas Actuator (LIA), Linear high thrust, long soft magnetic alloysPermanent Magnet travel, and high (e.g. CoNiFe [1]) Synchronous Actuatorefficiency using Some varieties (LPMSA), Linear planar also requireReluctance semiconductor permanent magnetic Synchronous Actuatorfabrication materials such as (LRSA), Linear techniques Neodymium ironSwitched Reluctance Long actuator boron (NdFeB) Actuator (LSRA), andtravel is available Requires the Linear Stepper Medium force is complexmulti- Actuator (LSA). available phase drive circuitry Low voltage Highcurrent operation operation Operational Mode Description AdvantagesDisadvantages Examples Basic Operation Mode Actuator This is thesimplest Simple operation Drop repetition Thermal ink jet directly modeof operation: the No external rate is usually Piezoelectric pushes inkactuator directly fields required limited to less than inkjet suppliessufficient Satellite drops 10 kHz. However, this IJ01, IJ02, IJ03,kinetic energy to expel can be avoided if is not fundamental IJ04, IJ05,IJ06, the drop. The drop drop velocity is less to the method, but isIJ07, IJ09, IJ11, must have a sufficient than 4 m/s related to therefill IJ12, IJ14, IJ16, velocity to overcome Can be efficient, methodnormally IJ20, IJ22, IJ23, the surface tension. depending upon the usedIJ24, IJ25, IJ26, actuator used All of the drop IJ27, IJ28, IJ29,kinetic energy must IJ30, IJ31, IJ32, be provided by the IJ33, IJ34,IJ35, actuator IJ36, IJ37, IJ38, Satellite drops IJ39, IJ40, IJ41,usually form if drop IJ42, IJ43, IJ44 velocity is greater than 4.5 m/sProximity The drops to be Very simple print Requires close Silverbrook,EP printed are selected by head fabrication can proximity between 0771658 A2 and some manner (e.g. be used the print head and related patentthermally induced The drop the print media or applications surfacetension selection means transfer roller reduction of does not need toMay require two pressurized ink). provide the energy print headsprinting Selected drops are required to separate alternate rows of theseparated from the ink the drop from the image in the nozzle by nozzleMonolithic color contact with the print print heads are medium or atransfer difficult roller. Electro- The drops to be Very simple printRequires very Silverbrook, EP static pull printed are selected by headfabrication can high electrostatic 0771 658 A2 and on ink some manner(e.g. be used field related patent thermally induced The dropElectrostatic field applications surface tension selection means forsmall nozzle Tone-Jet reduction of does not need to sizes is above airpressurized ink). provide the energy breakdown Selected drops arerequired to separate Electrostatic field separated from the ink the dropfrom the may attract dust in the nozzle by a nozzle strong electricfield. Magnetic The drops to be Very simple print Requires Silverbrook,EP pull on ink printed are selected by head fabrication can magnetic ink0771 658 A2 and some manner (e.g. be used Ink colors other relatedpatent thermally induced The drop than black are applications surfacetension selection means difficult reduction of does not need to Requiresvery pressurized ink). provide the energy high magnetic fields Selecteddrops are required to separate separated from the ink the drop from thein the nozzle by a nozzle strong magnetic field acting on the magneticink. Shutter The actuator moves a High speed (>50 Moving parts are IJ13,IJ17, IJ21 shutter to block ink KHz) operation can required flow to thenozzle. The be achieved due to Requires ink ink pressure is pulsedreduced refill time pressure modulator at a multiple of the Drop timingcan Friction and wear drop ejection be very accurate must be consideredfrequency. The actuator Stiction is energy can be very possible lowShuttered The actuator moves a Actuators with Moving parts are IJ08,IJ15, IJ18, grill shutter to block ink small travel can be required IJ19flow through a grill to used Requires ink the nozzle. The shutterActuators with pressure modulator movement need only small force can beFriction and wear be equal to the width used must be considered of thegrill holes. High speed (>50 Stiction is KHz) operation can possible beachieved Pulsed A pulsed magnetic Extremely low Requires an IJ10magnetic field attracts an ‘ink energy operation is external pulsed pullon ink pusher’ at the drop possible magnetic field pusher ejectionfrequency. An No heat Requires special actuator controls a dissipationmaterials for both catch, which prevents problems the actuator and thethe ink pusher from ink pusher moving when a drop is Complex not to beejected. construction Auxiliary Mechanism Description AdvantagesDisadvantages Examples Auxiliary mechanism (applied to all nozzles) NoneThe actuator directly Simplicity of Drop ejection Most ink jets, firesthe ink drop, and construction energy must be including there is noexternal Simplicity of supplied by piezoelectric and field or otheroperation individual nozzle thermal bubble. mechanism required. Smallphysical actuator IJ01-IJ07 size IJ09, IJ11, IJ12, IJ14, IJ20, IJ22,IJ23-IJ45 Oscillating The ink pressure Oscillating ink Requires externalSilverbrook, EP ink pressure oscillates, providing pressure can provideink pressure 0771 658 A2 and (including much of the drop a refill pulse,oscillator related patent acoustic ejection energy. The allowing higherInk pressure applications stimu- actuator selects which operating speedphase and amplitude IJ08, IJ13, IJ15, lation) drops are to be fired Theactuators must be carefully IJ17, IJ18, IJ19, by selectively may operatewith controlled IJ21 blocking or enabling much lower energy Acousticnozzles. The ink Acoustic lenses reflections in the ink pressureoscillation can be used to focus chamber must be may be achieved by thesound on the designed for vibrating the print nozzles head, orpreferably by an actuator in the ink supply. Media The print head is Lowpower Precision Silverbrook, EP proximity placed in close High accuracyassembly required 0771 658 A2 and proximity to the print Simple printhead Paper fibers may related patent medium. Selected construction causeproblems applications drops protrude from Cannot print on the print headfurther rough substrates than unselected drops, and contact the printmedium. The drop soaks into the medium fast enough to cause dropseparation. Transfer Drops are printed to a High accuracy BulkySilverbrook, EP roller transfer roller instead Wide range of Expensive0771 658 A2 and of straight to the print print substrates can Complexrelated patent medium. A transfer be used construction applicationsroller can also be used Ink can be dried Tektronix hot for proximitydrop on the transfer roller melt piezoelectric separation. ink jet Anyof the IJ series Electro- An electric field is Low power Field strengthSilverbrook, EP static used to accelerate Simple print head required for0771 658 A2 and selected drops towards construction separation of smallrelated patent the print medium. drops is near or applications above airTone-Jet breakdown Direct A magnetic field is Low power RequiresSilverbrook, EP magnetic used to accelerate Simple print head magneticink 0771 658 A2 and field selected drops of construction Requires strongrelated patent magnetic ink towards magnetic field applications theprint medium. Cross The print head is Does not require Requires externalIJ06, IJ16 magnetic placed in a constant magnetic materials magnet fieldmagnetic field. The to be integrated in Current densities Lorenz forcein a the print head may be high, current carrying wire manufacturingresulting in is used to move the process electromigration actuator.problems Pulsed A pulsed magnetic Very low power Complex print IJ10magnetic field is used to operation is possible head construction fieldcyclically attract a Small print head Magnetic paddle, which pushes sizematerials required in on the ink. A small print head actuator moves acatch, which selectively prevents the paddle from moving. Actuatoramplification Description Advantages Disadvantages Examples Actuatoramplification or midification method None No actuator Operational Manyactuator Thermal Bubble mechanical simplicity mechanisms have InkJetamplification is used. insufficient travel, IJ01, IJ02, IJ06, Theactuator directly or insufficient force, IJ07, IJ16, IJ25, drives thedrop to efficiently drive IJ26 ejection process. the drop ejectionprocess Differential An actuator material Provides greater High stressesare Piezoelectric expansion expands more on one travel in a reducedinvolved IJ03, IJ09, bend side than on the other. print head area Caremust be IJ17-IJ24, actuator The expansion may be taken that the IJ27,thermal, piezoelectric, materials do not IJ29-IJ39, magnetostrictive, ordelaminate IJ42, IJ43, IJ44 other mechanism. Residual bend resultingfrom high temperature or high stress during formation Transient Atrilayer bend Very good High stresses are IJ40, IJ41 bend actuator wherethe two temperature stability involved actuator outside layers are Highspeed, as a Care must be identical. This cancels new drop can be takenthat the bend due to ambient fired before heat materials do nottemperature and dissipates delaminate residual stress. The Cancelsresidual actuator only responds stress of formation to transient heatingof one side or the other. Actuator A series of thin Increased travelIncreased Some stack actuators are stacked. Reduced drive fabricationpiezoelectric ink jets This can be voltage complexity IJ04 appropriatewhere Increased actuators require high possibility of short electricfield strength, circuits due to such as electrostatic pinholes andpiezoelectric actuators. Multiple Multiple smaller Increases theActuator forces IJ12, IJ13, IJ18, actuators actuators are used forceavailable from may not add IJ20, IJ22, IJ28, simultaneously to anactuator linearly, reducing IJ42, IJ43 move the ink. Each Multipleefficiency actuator need provide actuators can be only a portion of thepositioned to control force required. ink flow accurately Linear Alinear spring is used Matches low Requires print IJ15 Spring totransform a motion travel actuator with head area for the with smalltravel and higher travel spring high force into a requirements longertravel, lower Non-contact force motion. method of motion transformationReverse The actuator loads a Better coupling Fabrication IJ05, IJ11spring spring. When the to the ink complexity actuator is turned off,High stress in the the spring releases. spring This can reverse theforce/distance curve of the actuator to make it compatible with theforce/time requirements of the drop ejection. Coiled A bend actuator isIncreases travel Generally IJ17, IJ21, IJ34, actuator coiled to provideReduces chip restricted to planar IJ35 greater travel in a areaimplementations reduced chip area. Planar due to extreme implementationsare fabrication difficulty relatively easy to in other orientations.fabricate. Flexure A bend actuator has a Simple means of Care must beIJ10, IJ19, IJ33 bend small region near the increasing travel of takennot to exceed actuator fixture point, which a bend actuator the elasticlimit in flexes much more the flexure area readily than the Stressremainder of the distribution is very actuator. The actuator unevenflexing is effectively Difficult to converted from an accurately modeleven coiling to an with finite element angular bend, resulting analysisin greater travel of the actuator tip. Gears Gears can be used to Lowforce, low Moving parts are IJ13 increase travel at the travel actuatorscan required expense of duration. be used Several actuator Circulargears, rack Can be fabricated cycles are required and pinion, ratchets,using standard More complex and other gearing surface MEMS driveelectronics methods can be used. processes Complex constructionFriction, friction, and wear are possible Catch The actuator controls aVery low Complex IJ10 small catch. The catch actuator energyconstruction either enables or Very small Requires external disablesmovement of actuator size force an ink pusher that is Unsuitable forcontrolled in a bulk pigmented inks manner. Buckle plate A buckle platecan be Very fast Must stay within S. Hirata et al, used to change a slowmovement elastic limits of the “An Ink-jet actuator into a fastachievable materials for long Head . . . ”, motion. It can also devicelife Proc. IEEE MEMS, convert a high force, High stresses Feb. 1996, pp418- low travel actuator involved 423. into a high travel, Generallyhigh IJ18, IJ27 medium force motion. power requirement Tapered A taperedmagnetic Linearizes the Complex IJ14 magnetic pole can increase magneticconstruction pole travel at the expense force/distance curve of force.Lever A lever and fulcrum is Matches low High stress IJ32, IJ36, IJ37used to transform a travel actuator with around the fulcrum motion withsmall higher travel travel and high force requirements into a motionwith Fulcrum area has longer travel and no linear movement, lower force.The lever and can be used for can also reverse the a fluid sealdirection of travel. Rotary The actuator is High mechanical Complex IJ28impeller connected to a rotary advantage construction impeller. A smallThe ratio of force Unsuitable for angular deflection of to travel of thepigmented inks the actuator results in actuator can be a rotation of thematched to the impeller vanes, which nozzle requirements push the inkagainst by varying the stationary vanes and number of impeller out ofthe nozzle. vanes Acoustic A refractive or No moving parts Large area1993 Hadimioglu lens diffractive (e.g. zone required et al, EUP 550,192plate) acoustic lens is Only relevant for 1993 Elrod et al, used toconcentrate acoustic ink jets EUP 572,220 sound waves. Sharp A sharppoint is used Simple Difficult to Tone-jet conductive to concentrate anconstruction fabricate using point electrostatic field. standard VLSIprocesses for a surface ejecting ink- jet Only relevant forelectrostatic ink jets Actuator motion Description AdvantagesDisadvantages Examples Actuator motion Volume The volume of the SimpleHigh energy is Hewlett-Packard expansion actuator changes, constructionin the typically required to Thermal Inkjet pushing the ink in all caseof thermal ink achieve volume Canon Bubblejet directions. jet expansion.This leads to thermal stress, cavitation, and kogation in thermal inkjet implementations Linear, The actuator moves in Efficient Highfabrication IJ01, IJ02, IJ04, normal to a direction normal to couplingto ink complexity may be IJ07, IJ11, IJ14 chip surface the print headsurface. drops ejected required to achieve The nozzle is typicallynormal to the perpendicular in the line of surface motion movement.Linear The actuator moves Suitable for Fabrication IJ12, IJ13, IJ15,parallel to parallel to the print planar fabrication complexity IJ33,IJ34, IJ35, chip surface head surface. Drop Friction IJ36 ejection maystill be Stiction normal to the surface. Membrane An actuator with a Theeffective Fabrication 1982 Howkins push high force but small area of theactuator complexity U.S. Pat. No. 4,459,601 area is used to push abecomes the Actuator size stiff membrane that is membrane areaDifficulty of in contact with the ink. integration in a VLSI processRotary The actuator causes Rotary levers Device IJ05, IJ08, IJ13, therotation of some may be used to complexity IJ28 element, such a grill orincrease travel May have impeller Small chip area friction at a pivotrequirements point Bend The actuator bends A very small Requires the1970 Kyser et al when energized. This change in actuator to be made U.S.Pat. No. 3,946,398 may be due to dimensions can be from at least two1973 Stemme differential thermal converted to a large distinct layers,or to U.S. Pat. No. 3,747,120 expansion, motion. have a thermal IJ03,IJ09, IJ10, piezoelectric difference across the IJ19, IJ23, IJ24,expansion, actuator IJ25, IJ29, IJ30, magnetostriction, or IJ31, IJ33,IJ34, other form of relative IJ35 dimensional change. Swivel Theactuator swivels Allows operation Inefficient IJ06 around a centralpivot. where the net linear coupling to the ink This motion is suitableforce on the paddle motion where there are is zero opposite forces Smallchip area applied to opposite requirements sides of the paddle, e.g.Lorenz force. Straighten The actuator is Can be used with Requirescareful IJ26, IJ32 normally bent, and shape memory balance of stressesstraightens when alloys where the to ensure that the energized. austenicphase is quiescent bend is planar accurate Double The actuator bends inOne actuator can Difficult to make IJ36, IJ37, IJ38 bend one directionwhen be used to power the drops ejected by one element is two nozzles.both bend directions energized, and bends Reduced chip identical. theother way when size. A small another element is Not sensitive toefficiency loss energized. ambient temperature compared to equivalentsingle bend actuators. Shear Energizing the Can increase the Not readily1985 Fishbeck actuator causes a shear effective travel of applicable toother U.S. Pat. No. 4,584,590 motion in the actuator piezoelectricactuator material. actuators mechanisms Radial con- The actuatorsqueezes Relatively easy High force 1970 Zoltan striction an inkreservoir, to fabricate single required U.S. Pat. No. 3,683,212 forcingink from a nozzles from glass Inefficient constricted nozzle. tubing asDifficult to macroscopic integrate with VLSI structures processesCoil/uncoil A coiled actuator Easy to fabricate Difficult to IJ17, IJ21,IJ34, uncoils or coils more as a planar VLSI fabricate for non- IJ35tightly. The motion of process planar devices the free end of the Smallarea Poor out-of-plane actuator ejects the ink. required, thereforestiffness low cost Bow The actuator bows (or Can increase the Maximumtravel IJ16, IJ18, IJ27 buckles) in the middle speed of travel isconstrained when energized. Mechanically High force rigid requiredPush-Pull Two actuators control The structure is Not readily IJ18 ashutter. One actuator pinned at both ends, suitable for ink jets pullsthe shutter, and so has a high out-of- which directly push the otherpushes it. plane rigidity the ink Curl A set of actuators curl Goodfluid flow Design IJ20, IJ42 inwards inwards to reduce the to the regionbehind complexity volume of ink that the actuator they enclose.increases efficiency Curl A set of actuators curl Relatively simpleRelatively large IJ43 outwards outwards, pressurizing construction chiparea ink in a chamber surrounding the actuators, and expelling ink froma nozzle in the chamber. Iris Multiple vanes enclose High efficiencyHigh fabrication IJ22 a volume of ink. These Small chip area complexitysimultaneously rotate, Not suitable for reducing the volume pigmentedinks between the vanes. Acoustic The actuator vibrates The actuator canLarge area 1993 Hadimioglu vibration at a high frequency. be physicallydistant required for et al, EUP 550,192 from the ink efficient operation1993 Elrod et al, at useful frequencies EUP 572,220 Acoustic couplingand crosstalk Complex drive circuitry Poor control of drop volume andposition None In various ink jet No moving parts Various otherSilverbrook, EP designs the actuator tradeoffs are 0771 658 A2 and doesnot move. required to related patent eliminate moving applications partsTone-jet Nozzle Refill method Description Advantages DisadvantagesExamples Nozzle Refill Method Surface After the actuator Fabrication Lowspeed Thermal inkjet tension is energized, simplicity Surface tensionPiezoelectric it typically returns Operational force relatively inkjetrapidly to its normal simplicity small compared to IJ01-IJ07, IJ10-position. This rapid actuator force IJ14, IJ16, IJ20, return sucks inair Long refill time IJ22-IJ45 through the nozzle usually dominatesopening. The ink the total repetition surface tension at the rate nozzlethen exerts a small force restoring the meniscus to a minimum area.Shuttered Ink to the nozzle High speed Requires IJ08, IJ13, IJ15,oscillating chamber is provided at Low actuator common ink IJ17, IJ18,IJ19, ink pressure a pressure that energy, as the pressure oscillatorIJ21 oscillates at twice the actuator need only May not be drop ejectionopen or close the suitable for frequency. When a shutter, instead ofpigmented inks drop is to be ejected, ejecting the ink drop the shutteris opened for 3 half cycles: drop ejection, actuator return, and refill.Refill After the main High speed, as Requires two IJ09 actuator actuatorhas ejected a the nozzle is independent drop a second (refill) activelyrefilled actuators per nozzle actuator is energized. The refill actuatorpushes ink into the nozzle chamber. The refill actuator returns slowly,to prevent its return from emptying the chamber again. Positive ink Theink is held a slight High refill rate, Surface spill Silverbrook, EPpressure positive pressure. therefore a high must be prevented 0771 658A2 and After the ink drop is drop repetition rate Highly related patentejected, the nozzle is possible hydrophobic print applications chamberfills quickly head surfaces are Alternative for:, as surface tension andrequired IJ01-IJ07, IJ10-IJ14, ink pressure both IJ16, IJ20, IJ22-IJ45operate to refill the nozzle. Inlet back- flow restriction methodDescription Advantages Disadvantages Examples Method of RestrictingBack-flow Through Inlet Long inlet The ink inlet channel Designsimplicity Restricts refill Thermal inkjet channel to the nozzle chamberOperational rate Piezoelectric is made long and simplicity May result ina inkjet relatively narrow, Reduces relatively large chip IJ42, IJ43relying on viscous crosstalk area drag to reduce inlet Only partiallyback-flow. effective Positive ink The ink is under a Drop selectionRequires a Silverbrook, EP pressure positive pressure, so and separationmethod (such as a 0771 658 A2 and that in the quiescent forces can benozzle rim or related patent state some of the ink reduced effectiveapplications drop already protrudes Fast refill time hydrophobizing, orPossible from the nozzle. both) to prevent operation of the This reducesthe flooding of the following: IJ01- pressure in the nozzle ejectionsurface of IJ07, IJ09-IJ12, chamber which is the print head. IJ14, IJ16,IJ20, required to eject a IJ22, IJ23-IJ34, certain volume of ink.IJ36-IJ41, IJ44 The reduction in chamber pressure results in a reductionin ink pushed out through the inlet. Baffle One or more baffles Therefill rate is Design HP Thermal Ink are placed in the inlet not asrestricted as complexity Jet ink flow. When the the long inlet Mayincrease Tektronix actuator is energized, method. fabricationpiezoelectric inkjet the rapid ink Reduces complexity (e.g. movementcreates crosstalk Tektronix hot melt eddies which restrict Piezoelectricprint the flow through the heads). inlet. The slower refill process isunrestricted, and does not result in eddies. Flexible flap In thismethod recently Significantly Not applicable to Canon restrictsdisclosed by Canon, reduces back-flow most inkjet inlet the expandingactuator for edge-shooter configurations (bubble) pushes on a thermalink jet Increased flexible flap that devices fabrication restricts theinlet. complexity Inelastic deformation of polymer flap results in creepover extended use Inlet Filter A filter is located Additional Restrictsrefill IJ04, IJ12, IJ24, between the ink inlet advantage of ink rateIJ27, IJ29, IJ30 and the nozzle filtration May result in chamber. Thefilter Ink filter may be complex has a multitude of fabricated with noconstruction small holes or slots, additional process restricting inkflow. steps The filter also removes particles which may block thenozzle. Small inlet The ink inlet channel Design simplicity Restrictsrefill IJ02, IJ37, IJ44 compared to the nozzle chamber rate to nozzlehas a substantially May result in a smaller cross section relativelylarge chip than that of the nozzle, area resulting in easier ink Onlypartially egress out of the effective nozzle than out of the inlet.Inlet shutter A secondary actuator Increases speed Requires separateIJ09 controls the position of of the ink-jet print refill actuator and ashutter, closing off head operation drive circuit the ink inlet when themain actuator is energized. The inlet is The method avoids the Back-flowRequires careful IJ01, IJ03, 1J05, located problem of inlet back-problem is design to minimize IJ06, IJ07, IJ10, behind the flow byarranging the eliminated the negative IJ11, IJ14, IJ16, ink-pushingink-pushing surface of pressure behind the IJ22, IJ23, IJ25, surface theactuator between paddle IJ28, IJ31, IJ32, the inlet and the IJ33, IJ34,IJ35, nozzle. IJ36, IJ39, IJ40, IJ41 Part of the The actuator and aSignificant Small increase in IJ07, IJ20, IJ26, actuator wall of the inkreductions in back- fabrication IJ38 moves to chamber are arranged flowcan be complexity shut off the so that the motion of achieved inlet theactuator closes off Compact designs the inlet. possible Nozzle In someconfigurations Ink back-flow None related to Silverbrook, EP actuator ofink jet, there is no problem is ink back-flow on 0771 658 A2 and doesnot expansion or eliminated actuation related patent result in inkmovement of an applications back-flow actuator which may Valve-jet causeink back-flow Tone-jet through the inlet. IJ08, IJ13, IJ15, IJ17 IJ18,IJ19, IJ21 Nozzle Clearing metnod Description Advantages DisadvantagesExamples Nozzle Clearing Method Normal All of the nozzles are No addedMay not be Most ink jet nozzle firing fired periodically, complexity onthe sufficient to systems before the ink has a print head displace driedink IJ01-IJ07, chance to dry. When IJ09-IJ12 not in use the nozzlesIJ14, IJ16, IJ20, are sealed (capped) IJ22 against air. IJ23-IJ34, Thenozzle firing is IJ36-IJ45 usually performed during a special clearingcycle, after first moving the print head to a cleaning station. Extra Insystems which heat Can be highly Requires higher Silverbrook, EP powerto the ink, but do not boil effective if the drive voltage for 0771 658A2 and ink heater it under normal heater is adjacent to clearing relatedpatent situations, nozzle the nozzle May require applications clearingcan be larger drive achieved by over- transistors powering the heaterand boiling ink at the nozzle. Rapid The actuator is fired in Does notrequire Effectiveness May be used succession rapid succession. In extradrive circuits depends with: of actuator some configurations, on theprint head substantially upon IJ01-IJ07, pulses this may cause heat Canbe readily the configuration of IJ09-IJ11 build-up at the nozzlecontrolled and the inkjet nozzle IJ14, IJ16, which boils the ink,initiated by digital IJ20, IJ22 clearing the nozzle. In logic IJ23-IJ25,other situations, it may IJ27-IJ34 cause sufficient IJ36-IJ45 vibrationsto dislodge clogged nozzles. Extra Where an actuator is A simple Notsuitable May be used power to not normally driven to solution wherewhere there is a with: IJ03, IJ09, ink pushing the limit of its motion,applicable hard limit to IJ16, IJ20, IJ23, actuator nozzle clearing maybe actuator movement IJ24, IJ25, IJ27, assisted by providing IJ29, IJ30,IJ31, an enhanced drive IJ32, IJ39, IJ40, signal to the actuator. IJ41,IJ42, IJ43, IJ44, IJ45 Acoustic An ultrasonic wave is A high nozzle HighIJ08, IJ13, IJ15, resonance applied to the ink clearing capabilityimplementation cost IJ17, IJ18, IJ19, chamber. This wave is can beachieved if system does not IJ21 of an appropriate May be alreadyinclude an amplitude and implemented at very acoustic actuator frequencyto cause low cost in systems sufficient force at the which alreadynozzle to clear include acoustic blockages. This is actuators easiest toachieve if the ultrasonic wave is at a resonant frequency of the inkcavity. Nozzle A microfabricated Can clear Accurate Silverbrook, EPclearing plate is pushed against severely clogged mechanical 0771 658 A2and plate the nozzles. The plate nozzles alignment is related patent hasa post for every required applications nozzle. The array of Moving partsare posts required There is risk of damage to the nozzles Accuratefabrication is required Ink The pressure of the ink May be effectiveRequires May be used pressure is temporarily where other pressure pumpor with all IJ series ink pulse increased so that ink methods cannot beother pressure jets streams from all of the used actuator nozzles. Thismay be Expensive used in conjunction Wasteful of ink with actuatorenergizing. Print head A flexible ‘blade’ is Effective for Difficult touse if Many ink jet wiper wiped across the print planar print head printhead surface is systems head surface. The surfaces non-planar or veryblade is usually Low cost fragile fabricated from a Requires flexiblepolymer, e.g. mechanical parts rubber or synthetic Blade can wearelastomer. out in high volume print systems Separate A separate heateris Can be effective Fabrication Can be used with ink boiling provided atthe nozzle where other nozzle complexity many IJ series ink heateralthough the normal clearing methods jets drop e-ection cannot be usedmechanism does not Can be require it. The heaters implemented at no donot require additional cost in individual drive some inkjet circuits, asmany configurations nozzles can be cleared simultaneously, and noimaging is required. Nozzle plate construction Description AdvantagesDisadvantages Examples Nozzle Plate Construction Electro- A nozzle plateis Fabrication High Hewlett Packard formed separately fabricatedsimplicity temperatures and Thermal Ink jet nickel from electroformedpressures are nickel, and bonded to required to bond the print headchip. nozzle plate Minimum thickness constraints Differential thermalexpansion Laser Individual nozzle No masks Each hole must CanonBubblejet ablated or holes are ablated by an required be individually1988 Sercel et drilled intense UV laser in a Can be quite fast formedal., SPIE, Vol. 998 polymer nozzle plate, which is Some control SpecialExcimer Beam typically a polymer over nozzle profile equipment requiredApplications, pp. such as polyimide or is possible Slow where there76-83 polysulphone Equipment are many thousands 1993 Watanabe requiredis relatively of nozzles per print et al., U.S. Pat. No. low cost head5,208,604 May produce thin burrs at exit holes Silicon A separate nozzleHigh accuracy is Two part K. Bean, IEEE micro- plate is attainableconstruction Transactions on machined micromachined from High costElectron Devices, single crystal silicon, Requires Vol. ED-25, No. 10,and bonded to the precision alignment 1978, pp 1185-1195 print headwafer. Nozzles may be Xerox 1990 clogged by adhesive Hawkins et al.,U.S. Pat. No. 4,899,181 Glass Fine glass capillaries No expensive Verysmall 1970 Zoltan capillaries are drawn from glass equipment requirednozzle sizes are U.S. Pat. No. 3,683,212 tubing. This method Simple tomake difficult to form has been used for single nozzles Not suited formaking individual mass production nozzles, but is difficult to use forbulk manufacturing of print heads with thousands of nozzles. Monolithic,The nozzle plate is High accuracy Requires Silverbrook, EP surfacedeposited as a layer (<1 μm) sacrificial layer 0771 658 A2 and micro-using standard VLSI Monolithic under the nozzle related patent machineddeposition techniques. Low cost plate to form the applications usingVLSI Nozzles are etched in Existing nozzle chamber IJ01, IJ02, IJ04,litho- the nozzle plate using processes can be Surface may be IJ11,IJ12, IJ17, graphic VLSI lithography and used fragile to the touch IJ18,IJ20, IJ22, processes etching. IJ24, IJ27, IJ28, IJ29, IJ30, IJ31, IJ32,IJ33, IJ34, IJ36, IJ37, IJ38, IJ39, IJ40, IJ41, IJ42, IJ43, IJ44Monolithic, The nozzle plate is a High accuracy Requires long IJ03,IJ05, IJ06, etched buried etch stop in the (<1 μm) etch times IJ07,IJ08, IJ09, through wafer. Nozzle Monolithic Requires a IJ10, IJ13,IJ14, substrate chambers are etched in Low cost support wafer IJ15,IJ16, IJ19, the front of the wafer, No differential IJ21, IJ23, IJ25,and the wafer is expansion IJ26 thinned from the back side. Nozzles arethen etched in the etch stop layer. No nozzle Various methods have Nonozzles to Difficult to Ricoh 1995 plate been tried to eliminate becomeclogged control drop Sekiya et al the nozzles entirely, to positionaccurately U.S. Pat. No. 5,412,413 prevent nozzle Crosstalk 1993Hadimioglu clogging. These problems et al EUP 550,192 include thermalbubble 1993 Elrod et al mechanisms and EUP 572,220 acoustic lensmechanisms Trough Each drop ejector has Reduced Drop firing IJ35 atrough through manufacturing direction is sensitive which a paddlemoves. complexity to wicking. There is no nozzle Monolithic plate.Nozzle slit The elimination of No nozzles to Difficult to 1989 Saito etal instead of nozzle holes and become clogged control drop U.S. Pat. No.4,799,068 individual replacement by a slit position accurately nozzlesencompassing many Crosstalk actuator positions problems reduces nozzleclogging, but increases crosstalk due to ink surface waves Ejectiondirection Description Advantages Disadvantages Examples Drop ejectiondirection Edge Ink flow is along the Simple Nozzles limited CanonBubblejet (‘edge surface of the chip, construction to edge 1979 Endo etal GB shooter’) and ink drops are No silicon High resolution patent2,007,162 ejected from the chip etching required is difficult Xeroxheater-in- edge. Good heat Fast color pit 1990 Hawkins et al sinking viasubstrate printing requires U.S. Pat. No. 4,899,181 Mechanically oneprint head per Tone-jet strong color Ease of chip handing Surface Inkflow is along the No bulk silicon Maximum ink Hewlett-Packard (‘roofsurface of the chip, etching required flow is severely TIJ 1982 Vaughtet al shooter’) and ink drops are Silicon can make restricted U.S. Pat.No. 4,490,728 ejected from the chip an effective heat IJ02, IJ11, IJ12,surface, normal to the sink IJ20, IJ22 plane of the chip. Mechanicalstrength Through Ink flow is through the High ink flow Requires bulkSilverbrook, EP chip, chip, and ink drops are Suitable for siliconetching 0771 658 A2 and forward ejected from the front pagewidth printrelated patent (‘up surface of the chip. heads applications shooter’)High nozzle IJ04, IJ17, IJ18, packing density IJ24, IJ27-IJ45 thereforelow manufacturing cost Through Ink flow is through the High ink flowRequires wafer IJ01, IJ03, IJ05, chip, chip, and ink drops are Suitablefor thinning IJ06, IJ07, IJ08, reverse ejected from the rear pagewidthprint Requires special IJ09, IJ10, IJ13, (‘down surface of the chip.heads handling during IJ14, IJ15, IJ16, shooter’) High nozzlemanufacture IJ19, IJ21, IJ23, packing density IJ25, IJ26 therefore lowmanufacturing cost Through Ink flow is through the Suitable forPagewidth print Epson Stylus actuator actuator, which is notpiezoelectric print heads require Tektronix hot fabricated as part ofheads several thousand melt piezoelectric the same substrate asconnections to drive ink jets the drive transistors. circuits Cannot bemanufactured in standard CMOS fabs Complex assembly required Ink typDescription Advantages Disadvantages Examples Ink Type Aqueous, Waterbased ink which Environmentally Slow drying Most existing dye typicallycontains: friendly Corrosive inkjets water, dye, surfactant, No odorBleeds on paper All IJ series ink humectant, and May jets biocide.strikethrough Silverbrook, EP Modern ink dyes have Cockles paper 0771658 A2 and high water-fastness, related patent light fastnessapplications Aqueous, Water based ink which Environmentally Slow dryingIJ02, IJ04, IJ21, pigment typically contains: friendly Corrosive IJ26,IJ27, IJ30 water, pigment, No odor Pigment may Silverbrook, EPsurfactant, humectant, Reduced bleed clog nozzles 0771 658 A2 and andbiocide. Reduced wicking Pigment may related patent Pigments have anReduced clog actuator applications advantage in reduced strikethroughmechanisms Piezoelectric ink- bleed, wicking and Cockles paper jetsstrikethrough. Thermal ink jets (with significant restrictions) MethylMEK is a highly Very fast drying Odorous All IJ series ink Ethylvolatile solvent used Prints on various Flammable jets Ketone forindustrial printing substrates such as (MEK) on difficult surfacesmetals and plastics such as aluminum cans. Alcohol Alcohol based inksFast drying Slight odor All IJ series ink (ethanol, 2- can be used wherethe Operates at sub- Flammable jets butanol, printer must operate atfreezing and others) temperatures below temperatures the freezing pointof Reduced paper water. An example of cockle this is in-camera Low costconsumer photographic printing. Phase The ink is solid at No dryingtime- High viscosity Tektronix hot change room temperature, and inkinstantly freezes Printed ink melt piezoelectric (hot melt) is melted inthe print on the print medium typically has a ink jets head beforejetting. Almost any print ‘waxy’ feel 1989 Nowak Hot melt inks aremedium can be used Printed pages U.S. Pat. No. usually wax based, Nopaper cockle may ‘block’ 4,820,346 with a melting point occurs Inktemperature All IJ series ink around 80° C. After No wicking may beabove the jets jetting the ink freezes occurs curie point of almostinstantly upon No bleed occurs permanent magnets contacting the print Nostrikethrough Ink heaters medium or a transfer occurs consume powerroller. Long warm-up time Oil Oil based inks are High solubility Highviscosity: All IJ series ink extensively used in medium for some this isa significant jets offset printing. They dyes limitation for use in haveadvantages in Does not cockle inkjets, which improved paper usuallyrequire a characteristics on Does not wick low viscosity. Some paper(especially no through paper short chain and wicking or cockle).multi-branched oils Oil soluble dies and have a sufficiently pigmentsare required. low viscosity. Slow drying Micro- A microemulsion is aStops ink bleed Viscosity higher All IJ series ink emulsion stable, selfforming High dye than water jets emulsion of oil, water, solubility Costis slightly and surfactant. The Water, oil, and higher than watercharacteristic drop size amphiphilic soluble based ink is less than 100nm, dies can be used High surfactant and is determined by Can stabilizeconcentration the preferred curvature pigment required (around of thesurfactant. suspensions 5%)

[3020] Ink Jet Printing

[3021] A large number of new forms of ink jet printers have beendeveloped to facilitate alternative ink jet technologies for the imageprocessing and data distribution system. Various combinations of ink jetdevices can be included in printer devices incorporated as part of thepresent invention. Australian Provisional Patent Applications relatingto these ink jets which are specifically incorporated by crossreference. The serial numbers of respective corresponding US patentapplications are also provided for the sake of convenience. AustralianUS Patent/Patent Provisional Application and Number Filing Date TitleFiling Date PO8066 15 Jul. 1997 Image Creation Method 6,227,652 andApparatus (IJ01) (Jul. 10, 1998) PO8072 15 Jul. 1997 Image CreationMethod 6,213,588 and Apparatus (IJ02) (Jul. 10, 1998) PO8040 15 Jul.1997 Image Creation Method 6,213,589 and Apparatus (IJ03) (Jul. 10,1998) PO8071 15 Jul. 1997 Image Creation Method 6,231,163 and Apparatus(IJ04) (Jul. 10, 1998) PO8047 15 Jul. 1997 Image Creation Method6,247,795 and Apparatus (IJ05) (Jul. 10, 1998) PO8035 15 Jul. 1997 ImageCreation Method 6,394,581 and Apparatus (IJ06) (Jul. 10, 1998) PO8044 15Jul. 1997 Image Creation Method 6,244,691 and Apparatus (IJ07) (Jul. 10,1998) PO8063 15 Jul. 1997 Image Creation Method 6,257,704 and Apparatus(IJ08) (Jul. 10, 1998) PO8057 15 Jul. 1997 Image Creation Method6,416,168 and Apparatus (IJ09) (Jul. 10, 1998) PO8056 15 Jul. 1997 ImageCreation Method 6,220,694 and Apparatus (IJ10) (Jul. 10, 1998) PO8069 15Jul. 1997 Image Creation Method 6,257,705 and Apparatus (IJ11) (Jul. 10,1998) PO8049 15 Jul. 1997 Image Creation Method 6,247,794 and Apparatus(IJ12) (Jul. 10, 1998) PO8036 15 Jul. 1997 Image Creation Method6,234,610 and Apparatus (IJ13) (Jul. 10, 1998) PO8048 15 Jul. 1997 ImageCreation Method 6,247,793 and Apparatus (IJ14) (Jul. 10, 1998) PO8070 15Jul. 1997 Image Creation Method 6,264,306 and Apparatus (IJ15) (Jul. 10,1998) PO8067 15 Jul. 1997 Image Creation Method 6,241,342 and Apparatus(IJ16) (Jul. 10, 1998) PO8001 15 Jul. 1997 Image Creation Method6,247,792 and Apparatus (IJ17) (Jul. 10, 1998) PO8038 15 Jul. 1997 ImageCreation Method 6,264,307 and Apparatus (IJ18) (Jul. 10, 1998) PO8033 15Jul. 1997 Image Creation Method 6,254,220 and Apparatus (IJ19) (Jul. 10,1998) PO8002 15 Jul. 1997 Image Creation Method 6,234,611 and Apparatus(IJ20) (Jul. 10, 1998) PO8068 15 Jul. 1997 Image Creation Method6,302,528 and Apparatus (IJ21) (Jul. 10, 1998) PO8062 15 Jul. 1997 ImageCreation Method 6,283,582 and Apparatus (IJ22) (Jul. 10, 1998) PO8034 15Jul. 1997 Image Creation Method 6,239,821 and Apparatus (IJ23) (Jul. 10,1998) PO8039 15 Jul. 1997 Image Creation Method 6,338,547 and Apparatus(IJ24) (Jul. 10, 1998) PO8041 15 Jul. 1997 Image Creation Method6,247,796 and Apparatus (IJ25) (Jul. 10, 1998) PO8004 15 Jul. 1997 ImageCreation Method 09/113,122 and Apparatus (IJ26) (Jul. 10, 1998) PO803715 Jul. 1997 Image Creation Method 6,390,603 and Apparatus (IJ27) (Jul.10, 1998) PO8043 15 Jul. 1997 Image Creation Method 6,362,843 andApparatus (IJ28) (Jul. 10, 1998) PO8042 15 Jul. 1997 Image CreationMethod 6,293,653 and Apparatus (IJ29) (Jul. 10, 1998) PO8064 15 Jul.1997 Image Creation Method 6,312,107 and Apparatus (IJ30) (Jul. 10,1998) PO9389 23 Sep. 1997 Image Creation Method 6,227,653 and Apparatus(IJ31) (Jul. 10, 1998) PO9391 23 Sep. 1997 Image Creation Method6,234,609 and Apparatus (IJ32) (Jul. 10, 1998) PP0888 12 Dec. 1997 ImageCreation Method 6,238,040 and Apparatus (IJ33) (Jul. 10, 1998) PP0891 12Dec. 1997 Image Creation Method 6,188,415 and Apparatus (IJ34) (Jul. 10,1998) PP0890 12 Dec. 1997 Image Creation Method 6,227,654 and Apparatus(IJ35) (Jul. 10, 1998) PP0873 12 Dec. 1997 Image Creation Method6,209,989 and Apparatus (IJ36) (Jul. 10, 1998) PP0993 12 Dec. 1997 ImageCreation Method 6,247,791 and Apparatus (IJ37) (Jul. 10, 1998) PP0890 12Dec. 1997 Image Creation Method 6,336,710 and Apparatus (IJ38) (Jul. 10,1998) PP1398 19 Jan. 1998 An Image Creation Method 6,217,153 andApparatus (IJ39) (Jul. 10, 1998) PP2592 25 Mar. 1998 An Image CreationMethod 6,416,167 and Apparatus (IJ40) (Jul. 10, 1998) PP2593 25 Mar.1998 Image Creation Method 6,243,113 and Apparatus (IJ41) (Jul. 10,1998) PP3991 9 Jun. 1998 Image Creation Method 6,283,581 and Apparatus(IJ42) (Jul. 10, 1998) PP3987 9 Jun. 1998 Image Creation Method6,247,790 and Apparatus (IJ43) (Jul. 10, 1998) PP3985 9 Jun. 1998 ImageCreation Method 6,260,953 and Apparatus (IJ44) (Jul. 10, 1998) PP3983 9Jun. 1998 Image Creation Method 6,267,469 and Apparatus (IJ45) (Jul. 10,1998)

[3022] Ink Jet Manufacturing

[3023] Further, the present application may utilize advancedsemiconductor fabrication techniques in the construction of large arraysof ink jet printers. Suitable manufacturing techniques are described inthe following Australian provisional patent specifications incorporatedhere by cross-reference. The serial numbers of respective correspondingUS patent applications are also provided for the sake of convenience.Australian US Patent/Patent Provisional Application and Number FilingDate Title Filing Date PO7935 15 Jul. 1997 A Method of Manufacture6,224,780 of an Image (Jul. 10, 1998) Creation Apparatus (IJM01) PO793615 Jul. 1997 A Method of Manufacture 6,235,212 of an Image (Jul. 10,1998) Creation Apparatus (IJM02) PO7937 15 Jul. 1997 A Method ofManufacture 6,280,643 of an Image (Jul. 10, 1998) Creation Apparatus(IJM03) PO8061 15 Jul. 1997 A Method of Manufacture 6,284,147 of anImage (Jul. 10, 1998) Creation Apparatus (IJM04) PO8054 15 Jul. 1997 AMethod of Manufacture 6,214,244 of an Image (Jul. 10, 1998) CreationApparatus (IJM05) PO8065 15 Jul. 1997 A Method of Manufacture 6,071,750of an Image (Jul. 10, 1998) Creation Apparatus (IJM06) PO8055 15 Jul.1997 A Method of Manufacture 6,267,905 of an Image (Jul. 10, 1998)Creation Apparatus (IJM07) PO8053 15 Jul. 1997 A Method of Manufacture6,251,298 of an Image (Jul. 10, 1998) Creation Apparatus (IJM08) PO807815 Jul. 1997 A Method of Manufacture 6,258,285 of an Image (Jul. 10,1998) Creation Apparatus (IJM09) PO7933 15 Jul. 1997 A Method ofManufacture 6,225,138 of an Image (Jul. 10, 1998) Creation Apparatus(IJM10) PO7950 15 Jul. 1997 A Method of Manufacture 6,241,904 of anImage (Jul. 10, 1998) Creation Apparatus (IJM11) PO7949 15 Jul. 1997 AMethod of Manufacture 6,299,786 of an Image (Jul. 10, 1998) CreationApparatus (IJM12) PO8060 15 Jul. 1997 A Method of Manufacture 09/113,124of an Image (Jul. 10, 1998) Creation Apparatus (IJM13) PO8059 15 Jul.1997 A Method of Manufacture 6,231,773 of an Image (Jul. 10, 1998)Creation Apparatus (IJM14) PO8073 15 Jul. 1997 A Method of Manufacture6,190,931 of an Image (Jul. 10, 1998) Creation Apparatus (IJM15) PO807615 Jul. 1997 A Method of Manufacture 6,248,249 of an Image (Jul. 10,1998) Creation Apparatus (IJM16) PO8075 15 Jul. 1997 A Method ofManufacture 6,290,862 of an Image (Jul. 10, 1998) Creation Apparatus(IJM17) PO8079 15 Jul. 1997 A Method of Manufacture 6,241,906 of anImage (Jul. 10, 1998) Creation Apparatus (IJM18) PO8050 15 Jul. 1997 AMethod of Manufacture 09/113,116 of an Image (Jul. 10, 1998) CreationApparatus (IJM19) PO8052 15 Jul. 1997 A Method of Manufacture 6,241,905of an Image (Jul. 10, 1998) Creation Apparatus (IJM20) PO7948 15 Jul.1997 A Method of Manufacture 6,451,216 of an Image (Jul. 10, 1998)Creation Apparatus (IJM21) PO7951 15 Jul. 1997 A Method of Manufacture6,231,772 of an Image (Jul. 10, 1998) Creation Apparatus (IJM22) PO807415 Jul. 1997 A Method of Manufacture 6,274,056 of an Image (Jul. 10,1998) Creation Apparatus (IJM23) PO7941 15 Jul. 1997 A Method ofManufacture 6,290,861 of an Image (Jul. 10, 1998) Creation Apparatus(IJM24) PO8077 15 Jul. 1997 A Method of Manufacture 6,248,248 of anImage (Jul. 10, 1998) Creation Apparatus (IJM25) PO8058 15 Jul. 1997 AMethod of Manufacture 6,306,671 of an Image (Jul. 10, 1998) CreationApparatus (IJM26) PO8051 15 Jul. 1997 A Method of Manufacture 6,331,258of an Image (Jul. 10, 1998) Creation Apparatus (IJM27) PO8045 15 Jul.1997 A Method of Manufacture 6,110,754 of an Image (Jul. 10, 1998)Creation Apparatus (IJM28) PO7952 15 Jul. 1997 A Method of Manufacture6,294,101 of an Image (Jul. 10, 1998) Creation Apparatus (IJM29) PO804615 Jul. 1997 A Method of Manufacture 6,416,679 of an Image (Jul. 10,1998) Creation Apparatus (IJM30) PO8503 11 Aug. 1997 A Method ofManufacture 6,264,849 of an Image (Jul. 10, 1998) Creation Apparatus(IJM30a) PO9390 23 Sep. 1997 A Method of Manufacture 6,254,793 of anImage (Jul. 10, 1998) Creation Apparatus (IJM31) PO9392 23 Sep. 1997 AMethod of Manufacture 6,235,211 of an Image (Jul. 10, 1998) CreationApparatus (IJM32) PP0889 12 Dec. 1997 A Method of Manufacture 6,235,211of an Image (Jul. 10, 1998) Creation Apparatus (IJM35) PP0887 12 Dec.1997 A Method of Manufacture 6,264,850 of an Image (Jul. 10, 1998)Creation Apparatus (IJM36) PP0882 12 Dec. 1997 A Method of Manufacture6,258,284 of an Image (Jul. 10, 1998) Creation Apparatus (IJM37) PP087412 Dec. 1997 A Method of Manufacture 6,258,284 of an Image (Jul. 10,1998) Creation Apparatus (IJM38) PP1396 19 Jan. 1998 A Method ofManufacture 6,228,668 of an Image (Jul. 10, 1998) Creation Apparatus(IJM39) PP2591 25 Mar. 1998 A Method of Manufacture 6,180,427 of anImage (Jul. 10, 1998) Creation Apparatus (IJM41) PP3989 9 Jun. 1998 AMethod of Manufacture 6,171,875 of an Image (Jul. 10, 1998) CreationApparatus (IJM40) PP3990 9 Jun. 1998 A Method of Manufacture 6,267,904of an Image (Jul. 10, 1998) Creation Apparatus (IJM42) PP3986 9 Jun.1998 A Method of Manufacture 6,245,247 of an Image (Jul. 10, 1998)Creation Apparatus (IJM43) PP3984 9 Jun. 1998 A Method of Manufacture6,245,247 of an Image (Jul. 10, 1998) Creation Apparatus (IJM44) PP39829 Jun. 1998 A Method of Manufacture 6,231,148 of an Image (Jul. 10,1998) Creation Apparatus (IJM45)

[3024] Fluid Supply

[3025] Further, the present application may utilize an ink deliverysystem to the ink jet head. Delivery systems relating to the supply ofink to a series of ink jet nozzles are described in the followingAustralian provisional patent specifications, the disclosure of whichare hereby incorporated by cross-reference. The serial numbers ofrespective corresponding US patent applications are also provided forthe sake of convenience. Australian US Patent/Patent ProvisionalApplication and Number Filing Date Title Filing Date PO8003 15 Jul. 1997Supply Method 6,350,023 and Apparatus (F1) (Jul. 10, 1998) PO8005 15Jul. 1997 Supply Method 6,318,849 and Apparatus (F2) (Jul. 10, 1998)PO9404 23 Sep. 1997 A Device and 09/113,101 Method (F3) (Jul. 10, 1998)

[3026] MEMS Technology

[3027] Further, the present application may utilize advancedsemiconductor microelectromechanical techniques in the construction oflarge arrays of ink jet printers. Suitable microelectromechanicaltechniques are described in the following Australian provisional patentspecifications incorporated here by cross-reference. The serial numbersof respective corresponding US patent applications are also provided forthe sake of convenience. Australian US Patent/Patent ProvisionalApplication and Number Filing Date Title Filing Date PO7943 15 Jul. 1997A device (MEMS01) PO8006 15 Jul. 1997 A device (MEMS02) 6,087,638 (Jul.10, 1998) PO8007 15 Jul. 1997 A device (MEMS03) 09/113,093 (Jul. 10,1998) PO8008 15 Jul. 1997 A device (MEMS04) 6,340,222 (Jul. 10, 1998)PO8010 15 Jul. 1997 A device (MEMS05) 6,041,600 (Jul. 10, 1998) PO801115 Jul. 1997 A device (MEMS06) 6,299,300 (Jul. 10, 1998) PO7947 15 Jul.1997 A device (MEMS07) 6,067,797 (Jul. 10, 1998) PO7945 15 Jul. 1997 Adevice (MEMS08) 09/113,081 (Jul. 10, 1998) PO7944 15 Jul. 1997 A device(MEMS09) 6,286,935 (Jul. 10, 1998) PO7946 15 Jul. 1997 A device (MEMS10)6,044,646 (Jul. 10, 1998) PO9393 23 Sep. 1997 A Device and Method09/113,065 (MEMS11) (Jul. 10, 1998) PP0875 12 Dec. 1997 A Device(MEMS12) 09/113,078 (Jul. 10, 1998) PP0894 12 Dec. 1997 A Device andMethod 09/113,075 (MEMS13) (Jul. 10, 1998)

[3028] IR Technologies

[3029] Further, the present application may include the utilization of adisposable camera system such as those described in the followingAustralian provisional patent specifications incorporated here bycross-reference. The serial numbers of respective corresponding USpatent applications are also provided for the sake of convenience.Australian US Patent/Patent Provisional Application and Number FilingDate Title Filing Date PP0895 12 Dec. 1997 An Image Creation Method6,231,148 and Apparatus (IR01) (Jul. 10, 1998) PP0870 12 Dec. 1997 ADevice and Method (IR02) 09/113,106 (Jul. 10, 1998) PP0869 12 Dec. 1997A Device and Method (IR04) 6,293,658 (Jul. 10, 1998) PP0887 12 Dec. 1997Image Creation Method 09/113,104 and Apparatus (IR05) (Jul. 10, 1998)PP0885 12 Dec. 1997 An Image Production 6,238,033 System (IR06) (Jul.10, 1998) PP0884 12 Dec. 1997 Image Creation Method 6,312,070 andApparatus (IR10) (Jul. 10, 1998) PP0886 12 Dec. 1997 Image CreationMethod 6,238,111 and Apparatus (IR12) (Jul. 10, 1998) PP0871 12 Dec.1997 A Device and Method (IR13) 09/113,086 (Jul. 10, 1998) PP0876 12Dec. 1997 An Image Processing Method 09/113,094 and and Apparatus (IR14)(Jul. 10, 1998) PP0877 12 Dec. 1997 A Device and Method (IR16) 6,378,970(Jul. 10, 1998) PP0878 12 Dec. 1997 A Device and Method (IR17) 6,196,739(Jul. 10, 1998) PP0879 12 Dec. 1997 A Device and Method (IR18)09/112,774 (Jul. 10, 1998) PP0883 12 Dec. 1997 A Device and Method(IR19) 6,270,182 (Jul. 10, 1998) PP0880 12 Dec. 1997 A Device and Method(IR20) 6,152,619 (Jul. 10, 1998) PP0881 12 Dec. 1997 A Device and Method(IR21) 09/113,092 (Jul. 10, 1998)

[3030] DotCard Technologies

[3031] Further, the present application may include the utilization of adata distribution system such as that described in the followingAustralian provisional patent specifications incorporated here bycross-reference. The serial numbers of respective corresponding USpatent applications are also provided for the sake of convenience.Australian US Patent/Patent Provisional Application and Number FilingDate Title Filing Date PP2370 16 Mar. 1998 Data Processing Method09/112,781 and Apparatus (Dot01) (Jul. 10, 1998) PP2371 16 Mar. 1998Data Processing Method 09/113,052 and Apparatus (Dot02) (Jul. 10, 1998)

[3032] Artcam Technologies

[3033] Further, the present application may include the utilization ofcamera and data processing techniques such as an Artcam type device asdescribed in the following Australian provisional patent specificationsincorporated here by cross-reference. The serial numbers of respectivecorresponding US patent applications are also provided for the sake ofconvenience. Australian US Patent/Patent Provisional Application andNumber Filing Date Title Filing Date PO7991 15 Jul. 1997 ImageProcessing Method 09/113,060 and Apparatus (ART01) (Jul. 10, 1998)PO7988 15 Jul. 1997 Image Processing Method 6,476,863 and Apparatus(ART02) (Jul. 10, 1998) PO7993 15 Jul. 1997 Image Processing Method09/113,073 and Apparatus (ART03) (Jul. 10, 1998) PO9395 23 Sep. 1997Data Processing Method 6,322,181 and Apparatus (ART04) (Jul. 10, 1998)PO8017 15 Jul. 1997 Image Processing Method 09/112,747 and Apparatus(ART06) (Jul. 10, 1998) PO8014 15 Jul. 1997 Media Device (ART07)6,227,648 (Jul. 10, 1998) PO8025 15 Jul. 1997 Image Processing Method09/112,750 and Apparatus (ART08) (Jul. 10, 1998) PO8032 15 Jul. 1997Image Processing Method 09/112,746 and Apparatus (ART09) (Jul. 10, 1998)PO7999 15 Jul. 1997 Image Processing Method 09/112,743 and Apparatus(ART10) (Jul. 10, 1998) PO7998 15 Jul. 1997 Image Processing Method09/112,742 and Apparatus (ART11) (Jul. 10, 1998) PO8031 15 Jul. 1997Image Processing Method 09/112,741 and Apparatus (ART12) (Jul. 10, 1998)PO8030 15 Jul. 1997 Media Device (ART13) 6,196,541 (Jul. 10, 1998)PO7997 15 Jul. 1997 Media Device (ART15) 6,195,150 (Jul. 10, 1998)PO7979 15 Jul. 1997 Media Device (ART16) 6,362,868 (Jul. 10, 1998)PO8015 15 Jul. 1997 Media Device (ART17) 09/112,738 (Jul. 10, 1998)PO7978 15 Jul. 1997 Media Device (ART18) 09/113,067 (Jul. 10, 1998)PO7982 15 Jul. 1997 Data Processing Method 6,431,669 and Apparatus(ART19) (Jul. 10, 1998) PO7989 15 Jul. 1997 Data Processing Method6,362,869 and Apparatus (ART20) (Jul. 10, 1998) PO8019 15 Jul. 1997Media Processing Method 6,472,052 and Apparatus (ART21) (Jul. 10, 1998)PO7980 15 Jul. 1997 Image Processing Method 6,356,715 and Apparatus(ART22) (Jul. 10, 1998) PO8018 15 Jul. 1997 Image Processing Method09/112,777 and Apparatus (ART24) (Jul. 10, 1998) PO7938 15 Jul. 1997Image Processing Method 09/113,224 and Apparatus (ART25) (Jul. 10, 1998)PO8016 15 Jul. 1997 Image Processing Method 6,366,693 and Apparatus(ART26) (Jul. 10, 1998) PO8024 15 Jul. 1997 Image Processing Method6,329,990 and Apparatus (ART27) (Jul. 10, 1998) PO7940 15 Jul. 1997 DataProcessing Method 09/113,072 and Apparatus (ART28) (Jul. 10, 1998)PO7939 15 Jul. 1997 Data Processing Method 09/112,785 and Apparatus(ART29) (Jul. 10, 1998) PO8501 11 Aug. 1997 Image Processing Method6,137,500 and Apparatus (ART30) (Jul. 10, 1998) PO8500 11 Aug. 1997Image Processing Method 09/112,796 and Apparatus (ART31) (Jul. 10, 1998)PO7987 15 Jul. 1997 Data Processing Method 09/113,071 and Apparatus(ART32) (Jul. 10, 1998) PO8022 15 Jul. 1997 Image Processing Method6,398,328 and Apparatus (ART33) (Jul. 10, 1998) PO8497 11 Aug. 1997Image Processing Method 09/113,090 and Apparatus (ART34) (Jul. 10, 1998)PO8020 15 Jul. 1997 Data Processing Method 6,431,704 and Apparatus(ART38) (Jul. 10, 1998) PO8023 15 Jul. 1997 Data Processing Method09/113,222 and Apparatus (ART39) (Jul. 10, 1998) PO8504 11 Aug. 1997Image Processing Method 09/112,786 and Apparatus (ART42) (Jul. 10, 1998)PO8000 15 Jul. 1997 Data Processing Method 6,415,054 and Apparatus(ART43) (Jul. 10, 1998) PO7977 15 Jul. 1997 Data Processing Method09/112,782 and Apparatus (ART44) (Jul. 10, 1998) PO7934 15 Jul. 1997Data Processing Method 09/113,056 and Apparatus (ART45) (Jul. 10, 1998)PO7990 15 Jul. 1997 Data Processing Method 09/113,059 and Apparatus(ART46) (Jul. 10, 1998) PO8499 11 Aug. 1997 Image Processing Method6,486,886 and Apparatus (ART47) (Jul. 10, 1998) PO8502 11 Aug. 1997Image Processing Method 6,381,361 and Apparatus (ART48) (Jul. 10, 1998)PO7981 15 Jul. 1997 Data Processing Method 6,317,192 and Apparatus(ART50) (Jul. 10, 1998) PO7986 15 Jul. 1997 Data Processing Method09/113,057 and Apparatus (ART51) (Jul. 10, 1998) PO7983 15 Jul. 1997Data Processing Method 09/113,054 and Apparatus (ART52) (Jul. 10, 1998)PO8026 15 Jul. 1997 Image Processing Method 09/112,752 and Apparatus(ART53) (Jul. 10, 1998) PO8027 15 Jul. 1997 Image Processing Method09/112,759 and Apparatus (ART54) (Jul. 10, 1998) PO8028 15 Jul. 1997Image Processing Method 09/112,757 and Apparatus (ART56) (Jul. 10, 1998)PO9394 23 Sep. 1997 Image Processing Method 6,357,135 and Apparatus(ART57) (Jul. 10, 1998) PO9396 23 Sep. 1997 Data Processing Method09/113,107 and Apparatus (ART58) (Jul. 10, 1998) PO9397 23 Sep. 1997Data Processing Method 6,271,931 and Apparatus (ART59) (Jul. 10, 1998)PO9398 23 Sep. 1997 Data Processing Method 6,353,772 and Apparatus(ART60) (Jul. 10, 1998) PO9399 23 Sep. 1997 Data Processing Method6,106,147 and Apparatus (ART61) (Jul. 10, 1998) PO9400 23 Sep. 1997 DataProcessing Method 09/112,790 and Apparatus (ART62) (Jul. 10, 1998)PO9401 23 Sep. 1997 Data Processing Method 6,304,291 and Apparatus(ART63) (Jul. 10, 1998) PO9402 23 Sep. 1997 Data Processing Method09/112,788 and Apparatus (ART64) (Jul. 10, 1998) PO9403 23 Sep. 1997Data Processing Method 6,305,770 and Apparatus (ART65) (Jul. 10, 1998)PO9405 23 Sep. 1997 Data Processing Method 6,289,262 and Apparatus(ART66) (Jul. 10, 1998) PP0959 16 Dec. 1997 A Data Processing Method6,315,200 and Apparatus (ART68) (Jul. 10, 1998) PP1397 19 Jan. 1998 AMedia Device (ART69) 6,217,165 (Jul. 10, 1998)

[3034] It would be appreciated by a person skilled in the art thatnumerous variations and/or modifications may be made to the presentinvention as shown in the specific embodiment without departing from thespirit or scope of the invention as broadly described. The presentembodiment is, therefore, to be considered in all respects to beillustrative and not restrictive.

1. A method of determining an output data value of sensed data, themethod comprising the steps of: (a) dividing a sensed data value intothree contiguous regions comprising a middle region, a lower region, andan upper region, and: (b) with each value in the lower region,designating the corresponding bit value to be a first value; (c) witheach value in the upper region, designating the corresponding bit valueto be a second value; and (d) with each value in the middle region,utilising the spatially surrounding values to determine whether saidvalue in the middle region is a first value or a second value.
 2. A cardfor operating a device, said card being adapted to cooperate with saiddevice so as to cause the device to operate in a predetermined operationmode, wherein said card comprises, on a first surface, a visualrepresentation of said operation mode, and on a second surface, avisually encoded representation of said operation mode, said encodedrepresentation being readable by said device and decodable by saiddevice so as to cause the device to operate in said operation mode.
 3. Acard as claimed in claim 2, wherein said device comprises a cameraadapted to receive a sensed image, and means for transforming theappearance of the sensed image, wherein the visual representation isindicative of a mode of operation wherein a particular transformation isapplied to the sensed image.
 4. A card as claimed in claim 2, whereinsaid device comprises a book reader and said card includes a bookcontents portion for display by said book reader.
 5. A method ofdistributing information on a card, said method comprising the steps of:dividing a surface of the card into a plurality of predetermined areas;printing a first data portion onto a first predetermined area; utilisingsaid printed first data portion when reading information stored on saidcard; and when the information stored on the card is to be updated,identifying a second predetermined area to print further information onsaid card, said second predetermined area not having been previouslyutilised to print data.
 6. A method as claimed in claim 5, wherein saidpredetermined areas are selected in a predetermined order.
 7. A methodas claimed in claim 5, wherein said printing utilises a high resolutionink dot printer.
 8. A method as claimed in claim 5, wherein said dataportion is printed in an encoded form having a degree of faulttolerance.
 9. A method as claimed in claim 5, wherein said data portionis printed in a Reed-Solomon encoded form.
 10. A method as claimed inclaim 5, wherein said data portion is replicated in a chosenpredetermined area.
 11. A method as claimed in claim 10, wherein each ofsaid predetermined areas includes a number of border target markersindicating the location of said region.
 12. A method as claimed in claim11, wherein said border markers are utilised when reading informationstored on the card to locate said predetermined areas.
 13. A method asclaimed in claim 11, wherein said border targets comprise a relativelylarge area of a first colour and a relatively small area of a secondcolour located centrally of said relatively large area.
 14. A method asclaimed in claim 15, wherein said card is of a generally rectangularcredit card sized shape.
 15. An information carrier that comprises: acard; and a plurality of dots that are printed on the card, theplurality of dots carrying data representing a set of instructions thatare readable by a processing device, the array of dots having thefollowing characteristics: the dots are set out in a generallyrectangular array with a logical upper side, a logical lower side, alogical left side and a logical right side, with a data area bounded bythe logical sides; the dots define a plurality of targets that extendalong both the logical left and the right side of the array, each targetbeing identifiable as such by a reading device; the dots are positionedin a plurality of substantially parallel columns that extend between thelogical upper and lower sides of the array; and the dots define aplurality of clock markers that are positioned along each of the upperand lower logical sides of the array, in aligned pairs with each saidcolumn extending between clock markers of respective pairs.
 16. Aninformation carrier that comprises: a card; a plurality of dots that areprinted on the card, the plurality of dots carrying data representing aset of instructions that are readable by a processing device, the arrayof dots having the following characteristics: the dots are set out in agenerally rectangular array; the dots define a plurality of rectangulardata blocks making up the array, each rectangular data block having alogical left side, a logical right side, a logical upper side and alogical lower side; the dots define a plurality of targets that extendalong both the logical left side and the right side of the array, eachtarget being identifiable as such by a reading device; the dots of eachdata block are positioned in a plurality of substantially parallelcolumns that extend between the logical upper and lower sides of thedata block; and the dots define a plurality of clock markers that arepositioned along each of the upper and lower logical sides of the datablocks, in aligned pairs with each said column extending between clockmarkers of respective pairs.